]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: Make sure we remove H2_SF_NOTIFIED on subscribe
authorOlivier Houchard <cognet@ci0.org>
Fri, 28 Aug 2026 10:34:53 +0000 (12:34 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 3 Sep 2026 13:20:46 +0000 (15:20 +0200)
The mux h2 remembers that he woke a stream for writing, and as long as
the H2_SF_NOTIFIED flag is set, won't attempt to do so again. However,
if for any reason the stream does not try to send data, and just
subscribes, then it will never be woken up. So remove the flag on
subscribe.
This can happen for example, with tcpcheck using the proxy protocol, if
for any reason the proxy protocol handshake is not done yet, as tcpcheck
will just subscribe if it sees the CO_FL_WAIT_XPRT flag.

This should be backported up to 2.8.

src/mux_h2.c

index 92ababe061f0a18d20d555544235c9fcf8da0c4f..d336fcad3fbba0de0a030b0fdaacbd3ab622e41d 100644 (file)
@@ -7923,6 +7923,12 @@ static int h2_subscribe(struct stconn *sc, int event_type, struct wait_event *es
 
        if (event_type & SUB_RETRY_SEND) {
                TRACE_DEVEL("subscribe(send)", H2_EV_STRM_SEND, h2c->conn, h2s);
+               /*
+                * If the caller subscribes, that means he was enable to send
+                * data, so let's not pretend it has already been notified
+                * he could, this is obviously obsolete.
+                */
+               h2s->flags &= ~H2_SF_NOTIFIED;
                if (!(h2s->flags & H2_SF_BLK_SFCTL) &&
                    !LIST_INLIST(&h2s->list)) {
                        if (h2s->flags & H2_SF_BLK_MFCTL) {