diff --git a/src/backend.c b/src/backend.c index 5cfa26311..0c824e668 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1141,6 +1141,12 @@ int assign_server_and_queue(struct stream *s) HA_SPIN_UNLOCK(QUEUE_LOCK, &p->queue->lock); _HA_ATOMIC_DEC(&p->queue->length); + + if (p->queue->sv) + _HA_ATOMIC_DEC(&p->queue->sv->queueslength); + else + _HA_ATOMIC_DEC(&p->queue->px->queueslength); + _HA_ATOMIC_INC(&p->queue->idx); _HA_ATOMIC_DEC(&s->be->totpend); diff --git a/src/queue.c b/src/queue.c index d5f737bf5..1f9f6d8ab 100644 --- a/src/queue.c +++ b/src/queue.c @@ -197,10 +197,14 @@ void pendconn_unlink(struct pendconn *p) if (done) { oldidx -= p->queue_idx; - if (sv) + if (sv) { p->strm->logs.srv_queue_pos += oldidx; - else + _HA_ATOMIC_DEC(&sv->queueslength); + } + else { p->strm->logs.prx_queue_pos += oldidx; + _HA_ATOMIC_DEC(&px->queueslength); + } _HA_ATOMIC_DEC(&q->length); _HA_ATOMIC_DEC(&px->totpend);