]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: do not stop outgoing connections on stopping
authorWilly Tarreau <w@1wt.eu>
Tue, 13 Oct 2020 16:09:15 +0000 (18:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 Oct 2020 16:15:33 +0000 (18:15 +0200)
There are reports of a few "SC" in logs during reloads when H2 is used
on the backend side. Christopher analysed this as being caused by the
proxy disabled test in h2_process(). As the comment says, this was done
for frontends only, and must absolutely not send a GOAWAY to the backend,
as all it will result in is to make newly queued streams fail.

The fix consists in simply testing the connection side before deciding
to send the GOAWAY.

This may be backported as far as 2.0, though for whatever reason it seems
to manifest itself only since 2.2 (probably due to changes in the outgoing
connection setup sequence).

src/mux_h2.c

index 1b73d2b46ffa5a6a95783ddfebe8859b29f9aa78..307bf90123ef1cd77be571a12df04113af8df173 100644 (file)
@@ -3609,7 +3609,7 @@ static int h2_process(struct h2c *h2c)
        }
        h2_send(h2c);
 
-       if (unlikely(h2c->proxy->disabled)) {
+       if (unlikely(h2c->proxy->disabled) && !(h2c->flags & H2_CF_IS_BACK)) {
                /* frontend is stopping, reload likely in progress, let's try
                 * to announce a graceful shutdown if not yet done. We don't
                 * care if it fails, it will be tried again later.