]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Check per-worker task_timeout overrides in configtest 5978/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Apr 2026 10:37:38 +0000 (13:37 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Apr 2026 10:37:38 +0000 (13:37 +0300)
The previous fix only validated cfg->task_timeout, missing cases where
individual workers (normal, controller) override task_timeout in their
own config section. Iterate cfg->workers and check each worker's
effective timeout via its UCL options object.

src/rspamadm/configtest.c

index de57efd32df356294a4475ef276ed64d88aded3b..7d06bdf9df7599af30f2c8379add917ff3c30c80 100644 (file)
@@ -156,6 +156,19 @@ rspamadm_configtest(int argc, char **argv, const struct rspamadm_command *cmd)
 
                if (ret) {
                        rspamd_worker_check_and_adjust_timeout(cfg, cfg->task_timeout);
+                       /* Also check per-worker task_timeout overrides */
+                       for (GList *cur = cfg->workers; cur != NULL; cur = g_list_next(cur)) {
+                               struct rspamd_worker_conf *wcf = (struct rspamd_worker_conf *) cur->data;
+                               if (wcf->options) {
+                                       const ucl_object_t *to = ucl_object_lookup(wcf->options, "task_timeout");
+                                       if (to == NULL) {
+                                               to = ucl_object_lookup(wcf->options, "check_timeout");
+                                       }
+                                       if (to != NULL) {
+                                               rspamd_worker_check_and_adjust_timeout(cfg, ucl_object_todouble(to));
+                                       }
+                               }
+                       }
                }
 
                if (ret) {