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.
diff --git a/src/backend.c b/src/backend.c
index 3e32797..aef58c2 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1305,7 +1305,7 @@
* 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);