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: unexpected ETIMEDOUT in connect on macOS 10.12 #19302

Closed
rsc opened this issue Feb 27, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@rsc
Copy link
Contributor

commented Feb 27, 2017

https://build.golang.org/log/79f69de95c47982e0981d7abb714cfa2638daf02 says

--- FAIL: TestDialerLocalAddr (75.14s)
	dial_test.go:705: tcp 0.0.0.0:0->::1: got dial tcp 0.0.0.0:0->[::1]:49338: getsockopt: operation timed out; want <nil>
FAIL
FAIL	net	78.009s

The error is misleading. It looks like we did getsockopt to ask for SO_ERROR and getsockopt did not itself fail but instead told us that the error associated with the socket was ETIMEDOUT. The code here (in (*netFD).connect) is a bit confusing and appears to be working around a different mystery, #14548.

One option would be to add ETIMEDOUT to the switch on syscall.Errno, alongside EINPROGRESS, EALREADY, EINTR. That would either fix the problem or create an infinite loop. It's hard to say which.

Speaking of infinite loops, I wonder if the confusing loop here is the underlying cause for #18541, #18741, #18877.

@rsc rsc added this to the Go1.9Early milestone Feb 27, 2017

@bradfitz bradfitz added the OS-Darwin label May 3, 2017

@bradfitz bradfitz modified the milestones: Go1.9, Go1.9Early May 3, 2017

@bradfitz bradfitz modified the milestones: Go1.10, Go1.9 Jun 13, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Jan 3, 2018

Change https://golang.org/cl/85997 mentions this issue: net: report connect error as coming from "connect"

@gopherbot gopherbot closed this in 3645418 Jan 3, 2018

@golang golang locked and limited conversation to collaborators Jan 3, 2019

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.