# You also need to define redis servers for this module
mx_check {
- # connection timeout in seconds
+ # TCP connection timeout in seconds. The effective symbol timeout is
+ # timeout + dns.timeout (see options.inc), so task_timeout must be set
+ # higher than their sum to avoid forced task termination.
timeout = 1.0;
# symbol yielded if no MX is connectable
symbol_bad_mx = "MX_INVALID";
/* Handle empty or absent strings equally */
if (value == nullptr || value[0] == '\0') {
+ /* Check if augmentation uses "key=value" format */
+ const char *eq = strchr(augmentation, '=');
+ if (eq != nullptr && eq != augmentation && eq[1] != '\0') {
+ return item->add_augmentation(*real_cache,
+ std::string_view{augmentation, static_cast<size_t>(eq - augmentation)},
+ std::string_view{eq + 1});
+ }
return item->add_augmentation(*real_cache, augmentation, std::nullopt);
}
g_assert(tres != 0);
if (tres->max_timeout > timeout) {
- msg_info_config("configured task_timeout %.2f is less than maximum symbols cache timeout %.2f; "
+ msg_warn_config("configured task_timeout %.2f is less than maximum symbols cache timeout %.2f; "
"some symbols can be terminated before checks",
timeout, tres->max_timeout);
GString *buf = g_string_sized_new(512);
tres->items[i].timeout);
}
}
- msg_info_config("list of top %d symbols by execution time: %v",
+ msg_warn_config("list of top %d symbols by execution time: %v",
(int) MIN(tres->nitems, max_displayed_items),
buf);
#include "cfg_rcl.h"
#include "rspamd.h"
#include "lua/lua_common.h"
+#include "worker_util.h"
static gboolean quiet = FALSE;
static char *config = NULL;
ret = FALSE;
}
+ if (ret) {
+ rspamd_worker_check_and_adjust_timeout(cfg, cfg->task_timeout);
+ }
+
if (ret) {
if (rspamd_lua_require_function(cfg->lua_state, "lua_cfg_utils", "check_configuration_errors")) {
GError *err = NULL;