From 5ce63372543646c512cd2876a904671fa34b88a1 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 23 Jan 2019 17:33:06 +0100 Subject: [PATCH] BUG/MEDIUM: backend: also remove from idle list muxes that have no more room The current test consists in removing muxes which report that they're going to assign their last available stream, but a mux may already be saturated without having passed in this situation at all. This is what happens with mux_h2 when receiving a GOAWAY frame informing the mux about the ID of the last stream the other end is willing to process. The limit suddenly changes from near infinite to 0. Currently what happens is that such a mux remains in the idle list for a long time and refuses all new streams. Now at least it will only fail a single stream in a retryable way. A future improvement should consist in trying to pick another connection from the idle list. This fix must be backported to 1.9. --- src/backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 3e327975e..aef58c2b9 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1305,7 +1305,7 @@ int connect_server(struct stream *s) * only create a new one if we don't have one already. */ if (!srv_cs) { - if (srv_conn->mux->avail_streams(srv_conn) == 1) { + if (srv_conn->mux->avail_streams(srv_conn) <= 1) { /* No more streams available, remove it from the list */ LIST_DEL(&srv_conn->list); LIST_INIT(&srv_conn->list);