From: Willy Tarreau Date: Wed, 30 Jan 2019 15:11:20 +0000 (+0100) Subject: BUG/MEDIUM: mux-h2: wake up flow-controlled streams on initial window update X-Git-Tag: v2.0-dev1~112 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=b1c9edc579aedd608107c4693c17160474b5ae62;p=haproxy-2.1.git BUG/MEDIUM: mux-h2: wake up flow-controlled streams on initial window update When a settings frame updates the initial window, all affected streams's window is updated as well. However the streams are not put back into the send list if they were already blocked on flow control. The effect is that such a stream will only be woken up by a WINDOW_UPDATE message but not by a SETTINGS changing the initial window size. This can be verified with h2spec's test http2/6.9.2/1 which occasionally fails without this patch. It is unclear whether this situation is really met in field, but the fix is trivial, it consists in adding each unblocked streams to the wait list as is done for the window updates. This fix must be backported to 1.9. For 1.8 the patch needs quite a few adaptations. It's better to copy-paste the code block from h2c_handle_window_update() adding the stream to the send_list when its mws is > 0. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 4019ec1..49e2068 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1426,6 +1426,14 @@ static void h2c_update_all_ws(struct h2c *h2c, int diff) while (node) { h2s = container_of(node, struct h2s, by_id); h2s->mws += diff; + + if (h2s->mws > 0 && (h2s->flags & H2_SF_BLK_SFCTL)) { + h2s->flags &= ~H2_SF_BLK_SFCTL; + if (h2s->send_wait) + LIST_ADDQ(&h2c->send_list, &h2s->list); + + } + node = eb32_next(node); } }