mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
BUG/MINOR: queue/debug: use the correct lock labels on the queue lock
A dedicated queue lock was added by commit 16fbdda3c
("MEDIUM: queue:
use a dedicated lock for the queues (v2)") but during its rebase, some
labels were lost and left to SERVER_LOCK / PROXY_LOCK instead of
QUEUE_LOCK. It's harmless but can confuse the lock debugger, so better
fix it.
No backport is needed.
This commit is contained in:
parent
19c5581b43
commit
47ee44fb71
16
src/queue.c
16
src/queue.c
@ -264,10 +264,10 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px, int
|
|||||||
/* the lock only remains held as long as the pp is
|
/* the lock only remains held as long as the pp is
|
||||||
* in the proxy's queue.
|
* in the proxy's queue.
|
||||||
*/
|
*/
|
||||||
HA_SPIN_LOCK(PROXY_LOCK, &px->queue.lock);
|
HA_SPIN_LOCK(QUEUE_LOCK, &px->queue.lock);
|
||||||
pp = pendconn_first(&px->queue.head);
|
pp = pendconn_first(&px->queue.head);
|
||||||
if (!pp)
|
if (!pp)
|
||||||
HA_SPIN_UNLOCK(PROXY_LOCK, &px->queue.lock);
|
HA_SPIN_UNLOCK(QUEUE_LOCK, &px->queue.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p && !pp)
|
if (!p && !pp)
|
||||||
@ -300,14 +300,14 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px, int
|
|||||||
use_pp:
|
use_pp:
|
||||||
/* Let's switch from the server pendconn to the proxy pendconn */
|
/* Let's switch from the server pendconn to the proxy pendconn */
|
||||||
__pendconn_unlink_prx(pp);
|
__pendconn_unlink_prx(pp);
|
||||||
HA_SPIN_UNLOCK(PROXY_LOCK, &px->queue.lock);
|
HA_SPIN_UNLOCK(QUEUE_LOCK, &px->queue.lock);
|
||||||
_HA_ATOMIC_DEC(&px->queue.length);
|
_HA_ATOMIC_DEC(&px->queue.length);
|
||||||
_HA_ATOMIC_INC(&px->queue.idx);
|
_HA_ATOMIC_INC(&px->queue.idx);
|
||||||
p = pp;
|
p = pp;
|
||||||
goto unlinked;
|
goto unlinked;
|
||||||
use_p:
|
use_p:
|
||||||
if (pp)
|
if (pp)
|
||||||
HA_SPIN_UNLOCK(PROXY_LOCK, &px->queue.lock);
|
HA_SPIN_UNLOCK(QUEUE_LOCK, &px->queue.lock);
|
||||||
__pendconn_unlink_srv(p);
|
__pendconn_unlink_srv(p);
|
||||||
_HA_ATOMIC_DEC(&srv->queue.length);
|
_HA_ATOMIC_DEC(&srv->queue.length);
|
||||||
_HA_ATOMIC_INC(&srv->queue.idx);
|
_HA_ATOMIC_INC(&srv->queue.idx);
|
||||||
@ -347,7 +347,7 @@ void process_srv_queue(struct server *s)
|
|||||||
* them will check the conditions again before quitting.
|
* them will check the conditions again before quitting.
|
||||||
*/
|
*/
|
||||||
while (!stop && s->served < (maxconn = srv_dynamic_maxconn(s))) {
|
while (!stop && s->served < (maxconn = srv_dynamic_maxconn(s))) {
|
||||||
if (HA_SPIN_TRYLOCK(SERVER_LOCK, &s->queue.lock) != 0)
|
if (HA_SPIN_TRYLOCK(QUEUE_LOCK, &s->queue.lock) != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
while (s->served < maxconn) {
|
while (s->served < maxconn) {
|
||||||
@ -357,7 +357,7 @@ void process_srv_queue(struct server *s)
|
|||||||
_HA_ATOMIC_INC(&s->served);
|
_HA_ATOMIC_INC(&s->served);
|
||||||
done++;
|
done++;
|
||||||
}
|
}
|
||||||
HA_SPIN_UNLOCK(SERVER_LOCK, &s->queue.lock);
|
HA_SPIN_UNLOCK(QUEUE_LOCK, &s->queue.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
@ -455,7 +455,7 @@ int pendconn_redistribute(struct server *s)
|
|||||||
if ((s->proxy->options & (PR_O_REDISP|PR_O_PERSIST)) != PR_O_REDISP)
|
if ((s->proxy->options & (PR_O_REDISP|PR_O_PERSIST)) != PR_O_REDISP)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
HA_SPIN_LOCK(SERVER_LOCK, &s->queue.lock);
|
HA_SPIN_LOCK(QUEUE_LOCK, &s->queue.lock);
|
||||||
for (node = eb32_first(&s->queue.head); node; node = nodeb) {
|
for (node = eb32_first(&s->queue.head); node; node = nodeb) {
|
||||||
nodeb = eb32_next(node);
|
nodeb = eb32_next(node);
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ int pendconn_redistribute(struct server *s)
|
|||||||
task_wakeup(p->strm->task, TASK_WOKEN_RES);
|
task_wakeup(p->strm->task, TASK_WOKEN_RES);
|
||||||
xferred++;
|
xferred++;
|
||||||
}
|
}
|
||||||
HA_SPIN_UNLOCK(SERVER_LOCK, &s->queue.lock);
|
HA_SPIN_UNLOCK(QUEUE_LOCK, &s->queue.lock);
|
||||||
|
|
||||||
if (xferred) {
|
if (xferred) {
|
||||||
_HA_ATOMIC_SUB(&s->queue.length, xferred);
|
_HA_ATOMIC_SUB(&s->queue.length, xferred);
|
||||||
|
Loading…
Reference in New Issue
Block a user