From: Olivier Houchard Date: Thu, 9 Jan 2025 16:43:41 +0000 (+0100) Subject: BUG/MEDIUM: queues: Adjust the proxy counters when appropriate X-Git-Tag: v3.2-dev4~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=659d5f6579e3595c261816a7ba73ef60898652bf;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: queues: Adjust the proxy counters when appropriate In process_srv_queue(), if we manage to successfully run an extra task, don't forget to adjust the proxy's totpend and served counters accordingly. Having an inaccurate served could lead to various subtle bugs, as it is used when making load balancing decisions. This should not be backported, unless cda7275ef5d5e49fb2ea2373ea3b1ba63fc927c3 is backported too. --- diff --git a/src/queue.c b/src/queue.c index 7c27e39ed9..8e532e6e96 100644 --- a/src/queue.c +++ b/src/queue.c @@ -452,8 +452,11 @@ int process_srv_queue(struct server *s) * checked, but before we set ready_srv so it would not see it, * just in case try to run one more stream. */ - if (pendconn_process_next_strm(s, p, px_ok)) + if (pendconn_process_next_strm(s, p, px_ok)) { + _HA_ATOMIC_SUB(&p->totpend, 1); + _HA_ATOMIC_ADD(&p->served, 1); done++; + } } return done; }