mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
Revert "MINOR: queue: update proxy->served once out of the loop"
This reverts commit3e92a31783. The recent changes since5304669e1MEDIUM: queue: make pendconn_process_next_strm() only return the pendconn opened a tiny race condition between stream_free() and process_srv_queue(), as the pendconn is accessed outside of the lock, possibly while it's being freed. A different approach is required.
This commit is contained in:
parent
e76fc3253d
commit
d83c98eb14
1 changed files with 2 additions and 3 deletions
|
|
@ -351,9 +351,10 @@ void process_srv_queue(struct server *s, int server_locked)
|
|||
if (!pc)
|
||||
break;
|
||||
|
||||
done++;
|
||||
done = 1;
|
||||
|
||||
_HA_ATOMIC_INC(&s->served);
|
||||
_HA_ATOMIC_INC(&p->served);
|
||||
|
||||
stream_add_srv_conn(pc->strm, s);
|
||||
task_wakeup(pc->strm->task, TASK_WOKEN_RES);
|
||||
|
|
@ -362,8 +363,6 @@ void process_srv_queue(struct server *s, int server_locked)
|
|||
if (!server_locked)
|
||||
HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
|
||||
|
||||
_HA_ATOMIC_ADD(&p->served, done);
|
||||
|
||||
if (done && p->lbprm.server_take_conn)
|
||||
p->lbprm.server_take_conn(s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue