]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: haload: fix rate limit bypass during stream errors
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 30 Jul 2026 07:23:01 +0000 (09:23 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 30 Jul 2026 07:26:43 +0000 (09:26 +0200)
In hld_strm_task(), stream errors triggered an unconditional task_wakeup()
on the user task. This bypassed arg_rate and caused haload to send connection
retries as fast as possible instead of respecting the configured request rate.

Call hld_usr_schedule() when arg_rate is set to guarantee that
rate pacing is preserved even when streams fail.

src/haload.c

index 9df8ce7f32e8c0b9756fecf4e799de1b89e17781..ee8ebe4708cfad4ac1acde45d832b00c2c480002 100644 (file)
@@ -1346,7 +1346,10 @@ struct task *hld_strm_task(struct task *t, void *context, unsigned int state)
        /* Note that the user task will release all the expired streams
         * attached to it.
         */
-       task_wakeup(usr->task, TASK_WOKEN_IO);
+       if (!arg_rate)
+               task_wakeup(usr->task, TASK_WOKEN_IO);
+       else
+               hld_usr_schedule(usr, arg_rate);
        LIST_DELETE(&hs->list);
        hldstream_free(&hs);
        t = NULL;