]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: servers: Call process_srv_queue() without lock when possible
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 3 Feb 2026 01:54:56 +0000 (02:54 +0100)
committerOlivier Houchard <ohouchard@haproxy.com>
Thu, 12 Feb 2026 01:19:38 +0000 (02:19 +0100)
In server_warmup(), call process_srv_queue() only once we released the
server lock, as we don't need it.

src/server.c

index 61663120ca5ba061ab97e69b34092bcb37dd1a89..925b0c4afd41826f17e8a458b839b8f97dd891b2 100644 (file)
@@ -5918,10 +5918,11 @@ static struct task *server_warmup(struct task *t, void *context, unsigned int st
        /* recalculate the weights and update the state */
        server_recalc_eweight(s, 1);
 
+       HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
+
        /* probably that we can refill this server with a bit more connections */
        process_srv_queue(s);
 
-       HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
 
        /* get back there in 1 second or 1/20th of the slowstart interval,
         * whichever is greater, resulting in small 5% steps.