]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: haload: restore request accounting after user timeouts
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 2 Nov 2026 15:57:00 +0000 (16:57 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 4 Nov 2026 15:34:45 +0000 (16:34 +0100)
The user path drops expired streams without releasing their active-stream
count or their tot_rconns slot, unlike the stream-error path. Once -r is
reached with fewer completions, running_tasks never falls back to zero and
haload hangs until it is killed.

Release both there, matching the error path; the timeout is still counted
as an error. This was introduced with haload in 3.5-dev, no backport needed.

src/haload.c

index 487574f2e898e31dc41e392a5be942f3ba77d96e..d80473765c1ca817f00825073e109cc3bae82906 100644 (file)
@@ -2010,6 +2010,12 @@ static struct task *hld_usr_task(struct task *t, void *context, unsigned int sta
                 * count it as a failure, not a success
                 */
                thrs_info[tid].tot_perr++;
+               BUG_ON(!thrs_info[tid].cur_req);
+               thrs_info[tid].cur_req--;
+               if (arg_rcon > 0) {
+                       BUG_ON(!hs->url->tot_rconn_sent);
+                       hs->url->tot_rconn_sent--;
+               }
                hs->url->mreqs++;
                usr->nreqs = usr->nreqs == -1 ? -1 : usr->nreqs + 1;
                LIST_DELETE(&hs->list);