comparison src/http/ngx_http_upstream_round_robin.c @ 5274:f06bbc08e457 stable-1.4

Upstream: fixed fail_timeout and max_fails > 1. Due to peer->checked always set since rev. c90801720a0c (1.3.0) by round-robin and least_conn balancers (ip_hash not affected), the code in ngx_http_upstream_free_round_robin_peer() function incorrectly reset peer->fails too often. Reported by Dmitry Popov, http://mailman.nginx.org/pipermail/nginx-devel/2013-May/003720.html
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 21 May 2013 21:47:50 +0400
parents 88a302caca75
children e6a1623f87bc
comparison
equal deleted inserted replaced
5273:83d028011ae2 5274:f06bbc08e457
521 m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t)); 521 m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
522 522
523 rrp->tried[n] |= m; 523 rrp->tried[n] |= m;
524 524
525 best->current_weight -= total; 525 best->current_weight -= total;
526 best->checked = now; 526
527 if (now - best->checked > best->fail_timeout) {
528 best->checked = now;
529 }
527 530
528 return best; 531 return best;
529 } 532 }
530 533
531 534