[PATCH] Upstream: silenced "temporary disabled" warnings with variables
Maxim Dounin
mdounin at mdounin.ru
Thu Feb 26 01:11:14 UTC 2026
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1772067385 -10800
# Thu Feb 26 03:56:25 2026 +0300
# Node ID 90f2bd990f0cd4419fdff3ac12f64ebcd80ad9e9
# Parent c5a5aa2658d7bd6c0ec17600dc6be11b93e8c1f5
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.
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