[nginx] Upstream: silenced "temporary disabled" warnings with va...
Maxim Dounin
mdounin at mdounin.ru
Fri Mar 6 04:08:56 UTC 2026
details: http://freenginx.org/hg/nginx/rev/52a4d08af7a5
branches:
changeset: 9469:52a4d08af7a5
user: Maxim Dounin <mdounin at mdounin.ru>
date: Fri Mar 06 06:54:13 2026 +0300
description:
Upstream: silenced "temporary disabled" warnings with variables.
Previously, if a server within a runtime-created upstream, as used for
proxy_pass with variables, failed, the "upstream server temporarily disabled"
warning was logged. For runtime-created upstreams the warning is useless
and confusing, since such upstreams are never used for other requests.
To disable the warning, max_fails is now set to 0 for runtime-created
upstreams. Additionally, fail_timeout is also set to 0, for consistency.
diffstat:
src/http/ngx_http_upstream_round_robin.c | 8 ++++----
src/stream/ngx_stream_upstream_round_robin.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diffs (50 lines):
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -356,8 +356,8 @@ ngx_http_upstream_create_round_robin_pee
peer[0].effective_weight = 1;
peer[0].current_weight = 0;
peer[0].max_conns = 0;
- peer[0].max_fails = 1;
- peer[0].fail_timeout = 10;
+ peer[0].max_fails = 0;
+ peer[0].fail_timeout = 0;
peers->peer = peer;
} else {
@@ -390,8 +390,8 @@ ngx_http_upstream_create_round_robin_pee
peer[i].effective_weight = 1;
peer[i].current_weight = 0;
peer[i].max_conns = 0;
- peer[i].max_fails = 1;
- peer[i].fail_timeout = 10;
+ peer[i].max_fails = 0;
+ peer[i].fail_timeout = 0;
*peerp = &peer[i];
peerp = &peer[i].next;
}
diff --git a/src/stream/ngx_stream_upstream_round_robin.c b/src/stream/ngx_stream_upstream_round_robin.c
--- a/src/stream/ngx_stream_upstream_round_robin.c
+++ b/src/stream/ngx_stream_upstream_round_robin.c
@@ -366,8 +366,8 @@ ngx_stream_upstream_create_round_robin_p
peer[0].effective_weight = 1;
peer[0].current_weight = 0;
peer[0].max_conns = 0;
- peer[0].max_fails = 1;
- peer[0].fail_timeout = 10;
+ peer[0].max_fails = 0;
+ peer[0].fail_timeout = 0;
peers->peer = peer;
} else {
@@ -400,8 +400,8 @@ ngx_stream_upstream_create_round_robin_p
peer[i].effective_weight = 1;
peer[i].current_weight = 0;
peer[i].max_conns = 0;
- peer[i].max_fails = 1;
- peer[i].fail_timeout = 10;
+ peer[i].max_fails = 0;
+ peer[i].fail_timeout = 0;
*peerp = &peer[i];
peerp = &peer[i].next;
}
More information about the nginx-devel
mailing list