From: Christopher Faulet Date: Wed, 7 Oct 2026 09:29:35 +0000 (+0200) Subject: BUG/MINOR: mux-h1: don't report a 408 error on timeout of a closed connection X-Git-Tag: v3.5-dev10~144 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=ad08f80596717c76da651346cf740834da38b313;p=haproxy.git BUG/MINOR: mux-h1: don't report a 408 error on timeout of a closed connection When a frontend connection times out, the mux H1 tries to send a 408 error to the client unless the connection is in the CLOSING state. But a connection may also be in the CLOSED state, waiting the client closes on its side. In that case too, no 408 must be emitted. Because of this issue, the failed requests counters are incremented, a "408 " log line is emitted while it should not. Now the error is only sent if the connection is still alive. It should be backported as far as 2.8. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 27b96e427..dc50929e7 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -4656,8 +4656,10 @@ struct task *h1_timeout_task(struct task *t, void *context, unsigned int state) return t; } - /* Try to send an error to the client */ - if (h1c->state != H1_CS_CLOSING && !(h1c->flags & (H1C_F_IS_BACK|H1C_F_ERROR|H1C_F_ABRT_PENDING))) { + /* Try to send an error to the client, unless the connection is + * already closing or closed (i.e. shut down for writes). + */ + if (h1_is_alive(h1c) && !(h1c->flags & (H1C_F_IS_BACK|H1C_F_ERROR|H1C_F_ABRT_PENDING))) { TRACE_DEVEL("timeout error detected", H1_EV_H1C_WAKE|H1_EV_H1C_ERR, h1c->conn, h1c->h1s); if (h1_handle_req_tout(h1c)) h1_send(h1c);