]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: servers: Only requeue servers if they are up
authorOlivier Houchard <ohouchard@haproxy.com>
Sat, 9 May 2026 17:27:12 +0000 (19:27 +0200)
committerOlivier Houchard <cognet@ci0.org>
Sat, 9 May 2026 17:06:10 +0000 (19:06 +0200)
In init_srv_requeue(), only attempt to run the tasklet if the server is
actually running, otherwise it will end up being queued a second time,
when the server is actually brought up, and that will lead to a
corrupted mt_list.
This can easily be reproduced by adding a dynamic server, as those start
disabled, and then enabling and disabling it a couple of times.
This should fix github issue #3360.

This should be backported up to 3.2.

src/server.c

index 8e49f79cf3ca2f0469855f71d712221ad763b4ed..ebc8ec2103f4134c4b3394f7dc7eca1dfc76c954 100644 (file)
@@ -6050,7 +6050,8 @@ static int init_srv_requeue(struct server *srv)
         * failed to queue itself when brought up, which could happen if
         * a memory allocation failed.
         */
-       tasklet_wakeup(t);
+       if (srv->cur_state != SRV_ST_STOPPED)
+               tasklet_wakeup(t);
        return ERR_NONE;
 }