From: Olivier Houchard Date: Thu, 18 Dec 2025 15:04:28 +0000 (+0100) Subject: BUG/MEDIUM: backend: Do not remove CO_FL_SESS_IDLE in assign_server() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40d16af7a68cf751fb7eb2dbe1c0870f90e44d82;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: backend: Do not remove CO_FL_SESS_IDLE in assign_server() Back in the mists of time, commit e91a526c8f decided that if we were trying to stay on the same server than the previous request, and if there were a connection available in the session, we'd remove its CO_FL_SESS_IDLE. The reason for doing that has been long lost, probably it fixed a bug at some point, but it was most probably not the right place to do that. And starting with 3.3, this triggers a BUG_ON() because that flag is expected later on. So just revert the commit, if the ancient bug shows up again, it will be fixed another way. This should be backported to 3.3. There is little reason to backport it to previous versions, unless other patches depend on it. --- diff --git a/src/backend.c b/src/backend.c index 34ec96711..587e3e7c0 100644 --- a/src/backend.c +++ b/src/backend.c @@ -661,10 +661,6 @@ int assign_server(struct stream *s) if (!(conn->flags & CO_FL_WAIT_XPRT)) { srv = tmpsrv; stream_set_srv_target(s, srv); - if (conn->flags & CO_FL_SESS_IDLE) { - conn->flags &= ~CO_FL_SESS_IDLE; - s->sess->idle_conns--; - } goto out_ok; } }