mirror of
https://github.com/nginx/nginx.git
synced 2026-08-27 04:07:18 +00:00
Upstream: limited next_upstream time and tries when resolving DNS.
When got multiple upstream IP addresses using DNS resolving, the number of upstreams tries and the maxinum time spent for these tries were not affected. This patch fixed it.
This commit is contained in:
parent
cf1e4781a9
commit
726c5726fb
1 changed files with 8 additions and 0 deletions
|
|
@ -981,6 +981,14 @@ ngx_http_upstream_resolve_handler(ngx_resolver_ctx_t *ctx)
|
|||
ngx_resolve_name_done(ctx);
|
||||
ur->ctx = NULL;
|
||||
|
||||
u->peer.start_time = ngx_current_msec;
|
||||
|
||||
if (u->conf->next_upstream_tries
|
||||
&& u->peer.tries > u->conf->next_upstream_tries)
|
||||
{
|
||||
u->peer.tries = u->conf->next_upstream_tries;
|
||||
}
|
||||
|
||||
ngx_http_upstream_connect(r, u);
|
||||
|
||||
failed:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue