aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2015-04-16 20:09:11 +0300
committerRuslan Ermilov <ru@nginx.com>2015-04-16 20:09:11 +0300
commit7c44e3922017de131e419d58b4346cd70e667ce8 (patch)
treeccb4af8fbf0ec341139819437e6a76c62c48ef9d /src
parentd72fe76bb19e4138f257f473988c45a7b022d599 (diff)
downloadnginx-7c44e3922017de131e419d58b4346cd70e667ce8.tar.gz
nginx-7c44e3922017de131e419d58b4346cd70e667ce8.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_upstream_ip_hash_module.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c
index debc0d8e5..d1d71e478 100644
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
@@ -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) {