mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Upstream: get rid of questionable micro-optimization in ip_hash.
If a peer was initially skipped due to max_fails, there's no reason not to try it again if enough time has passed, and the next_upstream logic is in action. This also reduces diffs with NGINX Plus.
This commit is contained in:
parent
d72fe76bb1
commit
7c44e39220
@ -216,23 +216,18 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
|
||||
"get ip hash peer, hash: %ui %04XA", p, m);
|
||||
|
||||
if (peer->down) {
|
||||
goto next_try;
|
||||
goto next;
|
||||
}
|
||||
|
||||
if (peer->max_fails
|
||||
&& peer->fails >= peer->max_fails
|
||||
&& now - peer->checked <= peer->fail_timeout)
|
||||
{
|
||||
goto next_try;
|
||||
goto next;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
next_try:
|
||||
|
||||
iphp->rrp.tried[n] |= m;
|
||||
pc->tries--;
|
||||
|
||||
next:
|
||||
|
||||
if (++iphp->tries > 20) {
|
||||
|
Loading…
Reference in New Issue
Block a user