From 23133a9bdfa73415a32f6c1cc9644a9e9f5cc37b Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 1 Jul 2020 18:56:30 +0200 Subject: [PATCH] BUG/MINOR: backend: Remove CO_FL_SESS_IDLE if a client remains on the last server When a connection is picked from the session server list because the proxy or the session are marked to use the last requested server, if it is idle, we must marked it as used removing the CO_FL_SESS_IDLE flag and decrementing the session idle_conns counter. This patch must be backported as far as 1.9. (cherry picked from commit e91a526c8fe7bf3b655057d41e8b72a2011b7046) Signed-off-by: Christopher Faulet --- src/backend.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend.c b/src/backend.c index 8ca5123..03751a5 100644 --- a/src/backend.c +++ b/src/backend.c @@ -628,6 +628,10 @@ int assign_server(struct stream *s) srv = tmpsrv; s->target = &srv->obj_type; + if (conn->flags & CO_FL_SESS_IDLE) { + conn->flags &= ~CO_FL_SESS_IDLE; + s->sess->idle_conns--; + } goto out_ok; } } -- 1.7.10.4