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.
This commit is contained in:
Willy Tarreau 2019-01-23 17:33:06 +01:00
parent 759ca1eacc
commit 5ce6337254

View 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);