-
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: DialTimeout causes persistent slowdown on windows #70751
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Comments
seankhliao
changed the title
net:DialTimeout causes mysterious side effects
net: DialTimeout causes persistent slowdown on windows
Dec 10, 2024
cc @golang/windows note that your timeout is unreasonably short for any sort of non local connection |
Thansk for reporting. Can you reproduce the same issue with Go 1.22? |
qmuntal
added
OS-Windows
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Dec 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Go version
go version go1.23.3 windows/amd64
Output of
go env
in your module/workspace:What did you do?
I am practicing with a simple port scanner. At first I used net.Dial and the program completes very fast as the following shows:
However when I switch to net.DialTimeout, the program beomes mysteriously slow (30~40 times slower). The side effect seems to be system level, rollback to net.Dial and recompile can't solve the problem. The side effect is gone after a restart.
I make some test and found out the side effect seems to happen after net.DialTimeout connect a non local address. DialTimeout on 127.0.0.1 is fine, after connecting a nonlocal ip address, the forementioned side effect is triggered. Dialing localhost becomes very slow(both net.Dial and net.DialTimeout ), and the only way to solve it is to restart.
Here is the full code:
What did you see happen?
As above.
What did you expect to see?
As above.
The text was updated successfully, but these errors were encountered: