]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: haload: count timed-out requests as errors, not successes
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 20 Aug 2026 13:35:27 +0000 (15:35 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 24 Aug 2026 17:16:05 +0000 (19:16 +0200)
In hld_usr_task(), requests reaped from the expiration list (no full
response received within -w) were counted as tot_done (success)
instead of tot_perr (failure). This made haload silently report
timeouts as successful requests, skewing tot_req/err in the live
summary and the final report.

src/haload.c

index 17cded45158e9a9567a6fc3af82c2aca684f745c..3f06a70417f90394b6e8864869a3c8a1c328e2d6 100644 (file)
@@ -53,7 +53,7 @@ struct hld_thr_info {
        uint32_t curusrs;            // number of active users
        uint32_t maxusrs;            // max number of users
        uint64_t tot_conn;           // total conns attempted on this thread
-       uint64_t tot_done;           // total requests finished (successes+failures)
+       uint64_t tot_done;           // total successful requests finished
        uint64_t tot_rcvd;           // total bytes received on this thread
        uint64_t tot_perr;           // total protocol errors on this thread
        uint64_t tot_fbs;            // total number of ttfb samples
@@ -1617,7 +1617,10 @@ static struct task *hld_usr_task(struct task *t, void *context, unsigned int sta
                        break;
 
                TRACE_STATE("expired task", HLD_EV_USR_TASK, hs);
-               thrs_info[tid].tot_done++;
+               /* this stream never got a full response within <arg_wait>:
+                * count it as a failure, not a success
+                */
+               thrs_info[tid].tot_perr++;
                hs->url->mreqs++;
                usr->nreqs = usr->nreqs == -1 ? -1 : usr->nreqs + 1;
                LIST_DELETE(&hs->list);