]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: backend: Do not remove CO_FL_SESS_IDLE in assign_server()
authorOlivier Houchard <cognet@ci0.org>
Thu, 18 Dec 2025 15:04:28 +0000 (16:04 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 18 Dec 2025 15:09:34 +0000 (16:09 +0100)
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.

src/backend.c

index 34ec96711702fcfcdfb0c740728ed8f97ce5702e..587e3e7c0b1eece17d506d0ac10b3b17e4904327 100644 (file)
@@ -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;
                                        }
                                }