mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 21:53:31 -06:00
Upstream: fixed unlocked access to peer->conns.
This commit is contained in:
parent
9b411460f9
commit
a2dac51398
@ -599,17 +599,20 @@ ngx_http_upstream_free_round_robin_peer(ngx_peer_connection_t *pc, void *data,
|
|||||||
|
|
||||||
peer = rrp->current;
|
peer = rrp->current;
|
||||||
|
|
||||||
|
ngx_http_upstream_rr_peers_rlock(rrp->peers);
|
||||||
|
ngx_http_upstream_rr_peer_lock(rrp->peers, peer);
|
||||||
|
|
||||||
if (rrp->peers->single) {
|
if (rrp->peers->single) {
|
||||||
|
|
||||||
peer->conns--;
|
peer->conns--;
|
||||||
|
|
||||||
|
ngx_http_upstream_rr_peer_unlock(rrp->peers, peer);
|
||||||
|
ngx_http_upstream_rr_peers_unlock(rrp->peers);
|
||||||
|
|
||||||
pc->tries = 0;
|
pc->tries = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_http_upstream_rr_peers_rlock(rrp->peers);
|
|
||||||
ngx_http_upstream_rr_peer_lock(rrp->peers, peer);
|
|
||||||
|
|
||||||
if (state & NGX_PEER_FAILED) {
|
if (state & NGX_PEER_FAILED) {
|
||||||
now = ngx_time();
|
now = ngx_time();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user