proxied request hang when DNS server down

ywsample ywsample at
Fri Aug 22 09:55:42 UTC 2014

hi Ruslan

>Please try the attached patch.  If you would like an attribution
>in a commit log, please tell me your real name.

thanks for the patch

I have a little idea, in ngx_resolver_timeout_handler function find the
next timeout request and add a timer if the time interval between two
requests exceeds the threshold, what do you think about it?

because this patch will appear premature timeout. For example if
resolver_timeout set to 5 seconds, the first request arrived at one second,
another request arrived at five seconds. Then when the the first request
timeout, the second request immediately returned because of they were
pending for the same dns query.
but the desired result is nginx will try to resend the dns query and if
success the second request process normal otherwise timeout at ten second.

ywsample :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list