Mailing List Archive

[7.4] cbf01b233 http2_send: Explain the winup-open discrepancy
commit cbf01b2339a5beba911299298aa5422dc3ad1e3a
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Mon Jan 29 10:59:22 2024 +0100

http2_send: Explain the winup-open discrepancy

diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index 316d13dc5..d642e31df 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -285,6 +285,18 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
assert (w > 0);
}

+ /* If all streams ran out of control flow window credits
+ * upon triggering h2_window_timeout, declare bankruptcy
+ * for the entire connection.
+ *
+ * But streams may be closed from the h2_sess thread while
+ * waiting for a window update. So the open_streams counter
+ * may be decremented in a different critical section than
+ * winup_streams, right before signalling the stream thread.
+ * So there may be more streams awaiting a window updates
+ * than streams officially open, hence the "lower-equal"
+ * comparison.
+ */
if (r2->error == H2SE_BROKE_WINDOW &&
h2->open_streams <= h2->winup_streams)
h2->error = r2->error = H2CE_BANKRUPT;
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit