]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: servers: Schedule the server requeue target on creation
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 1 Oct 2025 15:56:52 +0000 (17:56 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 1 Oct 2025 16:13:33 +0000 (18:13 +0200)
On creation, schedule the server requeue once it's been created.
It is possible that when the server went up, it tried to queue itself
into the lb specific code, failed to do so, and expect the tasklet to
run to take care of that.

This should be backported to 3.2.
This is part of an attempt to fix github issue #3143.

src/server.c

index f786e30d8a00c79d8eb33b28a75cd6df53be0a99..24f0c469272a75f0d67f90b393a0a700675113f6 100644 (file)
@@ -5964,6 +5964,12 @@ static int init_srv_requeue(struct server *srv)
        srv->requeue_tasklet = t;
        t->process = server_requeue;
        t->context = srv;
+       /*
+        * Run the tasklet once, in the very unlikely event the server
+        * failed to queue itself when brought up, which could happen if
+        * a memory allocation failed.
+        */
+       tasklet_wakeup(t);
        return ERR_NONE;
 }