From c2f1d0ee5e2d6a616918ee7978c1b23738faa639 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 24 May 2023 11:34:45 +0200 Subject: [PATCH] BUG/MEDIUM: mux-h2: Propagate termination flags when frontend SC is created We must evaluate if EOS/EOI/ERR_PENDING/ERROR flags must be set on the SE when the frontend SC is created because the rxbuf is transferred to the steeam at this stage. It means the call to h2_rcv_buf() may be skipped on some circumstances. And indeed, it happens when HAproxy quickly replies, for instance because of a deny rule. In this case, depending on the scheduling, the abort may block the receive attempt from the SC. In this case if SE flags were not properly set earlier, there is no way to terminate the request and the session may be freezed. For now, I can't explain why there is no timeout when this happens but it remains an issue because here we should not rely on timeouts to close the stream. This patch relies on following commits: * MINOR: mux-h2: Add a function to propagate termination flags from h2s to SE * MINOR: mux-h2: Set H2_SF_ES_RCVD flag when decoding the HEADERS frame The issue was encountered on the 2.8 but it seems the bug exists since the 2.4. But it is probably a good idea to only backport the series to 2.7 only and wait for a bug report on earlier versions. This patch should solve the issue #2147. --- src/mux_h2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mux_h2.c b/src/mux_h2.c index 2ca4d28a9a..b4dbb88ffb 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -2819,6 +2819,7 @@ static struct h2s *h2c_frt_handle_headers(struct h2c *h2c, struct h2s *h2s) h2s->st = H2_SS_OPEN; h2s->flags |= flags; h2s->body_len = body_len; + h2s_propagate_term_flags(h2c, h2s); done: if (h2s->flags & H2_SF_ES_RCVD) {