diff src/http/ngx_http_upstream_round_robin.c @ 6154:cca856715722

Upstream: report to error_log when max_fails is reached. This can be useful to understand why "no live upstreams" happens, in particular.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 20 May 2015 22:44:00 +0300
parents 4a640716f4e2
children 2cd019520210
line wrap: on
line diff
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -622,6 +622,11 @@ ngx_http_upstream_free_round_robin_peer(
 
         if (peer->max_fails) {
             peer->effective_weight -= peer->weight / peer->max_fails;
+
+            if (peer->fails >= peer->max_fails) {
+                ngx_log_error(NGX_LOG_WARN, pc->log, 0,
+                              "upstream server temporarily disabled");
+            }
         }
 
         ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,