]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: haload: make -e react to request timeouts too
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 20 Aug 2026 13:38:36 +0000 (15:38 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 24 Aug 2026 17:16:05 +0000 (19:16 +0200)
-e only triggered on connection/protocol errors, not on
requests that silently timed out waiting for a response. Now that
timeouts are correctly counted as errors (previous commit), make them
trigger -e the same way any other error does.

src/haload.c

index 3f06a70417f90394b6e8864869a3c8a1c328e2d6..ef3210002f63935eb2b5c04bdc4dcfcb0d555f60 100644 (file)
@@ -1625,6 +1625,11 @@ static struct task *hld_usr_task(struct task *t, void *context, unsigned int sta
                usr->nreqs = usr->nreqs == -1 ? -1 : usr->nreqs + 1;
                LIST_DELETE(&hs->list);
                hldstream_free(&hs);
+
+               if (arg_serr == 1) {
+                       usr->flags |= HLD_USR_FL_STOP;
+                       HA_ATOMIC_STORE(&all_usr_stop_asap, 1);
+               }
        }
 
        if ((usr->flags & HLD_USR_FL_STOP) || HA_ATOMIC_LOAD(&all_usr_stop_asap)) {