Upstream: report to error_log when max_fails is reached.
This can be useful to understand why "no live upstreams" happens,
in particular.
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
index 487b0e3..d6ae33b 100644
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -622,6 +622,11 @@
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,
diff --git a/src/stream/ngx_stream_upstream_round_robin.c b/src/stream/ngx_stream_upstream_round_robin.c
index c9157cd..efedb28 100644
--- a/src/stream/ngx_stream_upstream_round_robin.c
+++ b/src/stream/ngx_stream_upstream_round_robin.c
@@ -495,6 +495,11 @@
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_STREAM, pc->log, 0,