]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: backend: also remove from idle list muxes that have no more room
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Jan 2019 16:33:06 +0000 (17:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2019 12:53:06 +0000 (13:53 +0100)
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

index 3e327975e0813c0e1d5e0d6e6ac0a3c7101498cb..aef58c2b94d9e3bd678098e5a64161e2a74e36c4 100644 (file)
@@ -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);