Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: DNS timeout not implemented per spec #16885

Closed
axaxs opened this issue Aug 26, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@axaxs
Copy link

commented Aug 26, 2016

Per man resolv.conf -

"timeout:n
sets the amount of time the resolver will wait for a response from a remote name server before retrying the query via a different name server. Measured in seconds, the default is RES_TIMEOUT (currently 5, see <resolv.h>). The value for this option is silently capped to 30."

This indicates that after timeout seconds, the querier will move to the next server.

However, in Go 1.7, this seems to be a hard max timeout. The config structure is even noted as such -
"timeout time.Duration // wait before giving up on a query, including retries"

This in itself doesn't make much sense, since server iteration happens inside the retry for loop (which is correct).

Then in dnsclient_unix.go starting at 183, a hard deadline seems to add cfg.timeout to current time before even starting retries or iterations. Ideally instead this should be calculated and reset in the server for loop.

This is problematic because many set a low timeout in resolv.conf to keep a bad server from hanging for so long. Doing so now will cause queries to fail rather than move to next server as is supposed to happen.

Thanks
Alex A Skinner

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    1.7
  2. What operating system and processor architecture are you using (go env)?
    Linux amd64
@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 26, 2016

I'm pretty sure this is a dup of the discussion we're having in #16865. Do you agree?

@axaxs

This comment has been minimized.

Copy link
Author

commented Aug 26, 2016

Yep, missed that sorry. We're getting production errors now and I'm sure others will too with the move to 1.7. This can be closed as dupe, but this behavior described in both tickets is unexpected and really should be remedied.

Thank you

@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 26, 2016

Thanks.

@bradfitz bradfitz closed this Aug 26, 2016

@golang golang locked and limited conversation to collaborators Aug 26, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.