]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: debug: do not set task expiration to TICK_ETERNITY
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Nov 2024 14:37:38 +0000 (15:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Nov 2024 14:39:00 +0000 (15:39 +0100)
Using "debug task", it's possible to change a task's expiration, but
we must be careful not to set it to TICK_ETERNITY. Let's use tick_add()
instead. The risk is basically nul since it's a debugging command, so
no backport is needed.

src/debug.c

index 78940bfc4628fe3c680eb1c775465527df6a0775..ee99135439b2b493365b06334903a72b40875360 100644 (file)
@@ -1420,7 +1420,7 @@ static int debug_parse_cli_task(char **args, char *payload, struct appctx *appct
                        else if (task_ok) {
                                /* unlink task and wake with timer flag */
                                __task_unlink_wq(t);
-                               t->expire = now_ms;
+                               t->expire = tick_add(now_ms, 0);
                                task_wakeup(t, TASK_WOKEN_TIMER);
                        }
                } else if (strcmp(args[arg], "wake") == 0) {