-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: Resolver errors on Windows with code WSATRY_AGAIN
#55050
Comments
This failure occurred within a |
From what I can tell, the Per https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfoexw, the error text corresponds to the error code |
WSATRY_AGAIN
(attn @ianlancetaylor @neild; CC @golang/windows) I wonder if the |
This is closely related to #52094 and #52108 (CC @rolandshoemaker). |
A casual look in the source code shows that on Unix platforms EAGAIN is used often (and rightly so) go/src/internal/poll/fd_unix.go Line 166 in a2baae6
It's probably a great idea to handle WSATRY_AGAIN similarly in all windows related code and system calls that might return that error. |
How do you propose we change
We can also report
This code retries reads from TCP connections. I don't see how that code is relevant to Alex |
https://learn.microsoft.com/en-us/search/?terms=WSATRY_AGAIN: My meaning is that this error code is returned by several windows API functions, and should be handled for all of them that Go uses. |
Adding a data point: See this issue for more context: dotnet/runtime#29935, and specially this comment: dotnet/runtime#29935 (comment). |
The usual solution I would reach for is to retry with exponential backoff. It appears that all of the
But I'm curious what the Unix implementation does in terms of default timeouts and retries. There are two configuration parameters here that seem relevant: |
It looks like our default on Unix is 5 seconds and 2 attempts, unless the system's So that might be a good starting point, at least. (Ideally the defaults should be factored out to be platform-independent!) |
Found new dashboard test flakes for:
2022-09-09 20:29 windows-amd64-longtest go@54182ff5 cmd/go.TestScript (log)
|
Sounds reasonable to me. But I don't have time to implement that.
We can do 2 attempts. But I don't see how we can implement 5 seconds timeout by using just getaddrinfow. Perhaps attempts count should be the only possible DNS resolver config parameter on Windows. Alex |
I think the idea is to stop initiating retries after 5 seconds, not to cause each individual retry to time out at that boundary. |
That sounds reasonable. Thanks for explaining. Alex |
Change https://go.dev/cl/462051 mentions this issue: |
GetAddrInfoW is retried now multiple times as per the timeout and number of retries defined in func dnsReadConfig (before it was called only once) Fixes golang#55050 Change-Id: If5369ebb164d98557a802de938756dbf9c125773 Reviewed-on: https://go-review.googlesource.com/c/go/+/462051 TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Quim Muntal <[email protected]> Run-TryBot: Quim Muntal <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
Found new dashboard test flakes for:
2024-01-09 18:15 go1.20-windows-amd64-longtest release-branch.go1.20@a95136a8 net.TestLookupLocalPTR (log)
2024-01-09 18:17 go1.21-windows-amd64-race release-branch.go1.21@cc85462b net.TestLookupContextCancel (log)
2024-01-09 18:17 go1.21-windows-amd64-race release-branch.go1.21@cc85462b net.TestLookupGoogleHost (log)
2024-01-09 18:17 go1.21-windows-amd64-race release-branch.go1.21@cc85462b net.TestLookupGoogleIP (log)
|
2022-09-09T20:29:05-54182ff/windows-amd64-longtest
The text was updated successfully, but these errors were encountered: