BUG/MEDIUM: servers: Only requeue servers if they are up

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.
This commit is contained in:
Olivier Houchard 2026-05-09 19:27:12 +02:00 committed by Olivier Houchard
parent efb36c0daf
commit 2a1599297b

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