-
Notifications
You must be signed in to change notification settings - Fork 18k
net: dial to a non-existent address doen't return an error #8276
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
Labels
Comments
I pasted to play.golang.org from my local file and forgot to import package. Here is the correct one http://play.golang.org/p/T4FsbNsqkc |
interesting, could you please show/tell us; - the output of attached tcpinfo.go on your environment that happens your issue (you need to run "go get github.com/mikioh/tcp" first), - outputs of all routing information by using iproute2 (ip r/n/l/a) or similar command (pls don't forget to anonymize your private identifiers such as mac64/eui64 addresses), - how did you verify that address (100.100.100.100) is a non-existent address on your environment, your ip packet routing domain. Attachments:
|
The address is randomly picked, I've tried other addresses, any non-existent address will do. my 'ip r' output is : fe80::21f1:62c0:1c01:76a1 dev eth0 lladdr a4:1f:72:6b:52:e9 router STALE 10.12.104.1 dev wlan0 lladdr 44:2b:03:7d:15:4a STALE 10.12.113.1 dev eth0 lladdr 44:2b:03:7d:15:53 REACHABLE the output of tcpinfo.go is like: dial tcp 100.100.100.100:10000: i/o timeout dial tcp 100.100.100.100:10000: i/o timeout &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h31m58.388s LastDataReceived:4h31m58.388s LastAckReceived:4h31m58.388s CC:0xc20800ec00 SysInfo:0xc208018870} &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h31m58.388s LastDataReceived:4h31m58.388s LastAckReceived:4h31m58.388s CC:0xc20800ecc0 SysInfo:0xc2080188c0} &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h31m58.388s LastDataReceived:4h31m58.388s LastAckReceived:4h31m58.388s CC:0xc20800ed80 SysInfo:0xc208018910} &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h31m58.388s LastDataReceived:4h31m58.388s LastAckReceived:4h31m58.388s CC:0xc20800ee40 SysInfo:0xc208018960} dial tcp 100.100.100.100:10000: i/o timeout &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h31m59.388s LastDataReceived:4h31m59.388s LastAckReceived:4h31m59.388s CC:0xc20800ef60 SysInfo:0xc2080189b0} &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h31m59.388s LastDataReceived:4h31m59.388s LastAckReceived:4h31m59.388s CC:0xc20800f020 SysInfo:0xc208018a00} dial tcp 100.100.100.100:10000: i/o timeout &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h32m0.388s LastDataReceived:4h32m0.388s LastAckReceived:4h32m0.388s CC:0xc20800f140 SysInfo:0xc208018a50} &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h32m0.388s LastDataReceived:4h32m0.388s LastAckReceived:4h32m0.388s CC:0xc20800f200 SysInfo:0xc208018aa0} dial tcp 100.100.100.100:10000: i/o timeout &{State:syn-sent Options:[] PeerOptions:[] RTT:0 RTTVar:250ms RTO:1s ATO:0 LastDataSent:4h32m1.392s LastDataReceived:4h32m1.392s LastAckReceived:4h32m1.392s CC:0xc20800f320 SysInfo:0xc208018af0} ... |
nice, pretty interesting, looks like > State:syn-sent something similar to half-tcp hole punching happens. which version of linux are you running? also, if possible, pls let us know the detail of your network environment configuration (especially for ip-layer: sysctl states, iptables for nat44, 6rd/nat64/xlat for address translations and link-layer) for repro. i just tried to repro it on freebsd but failed. |
This issue was first caught on production environment which is CentOS 6.3. Our application works like sentinel who detects other application's failure by dialing its address, if the error is nil, we consider this application is alive. My local machine is Ubuntu 14.04 which can also reproduce this issue, and I didn't change any system variable since installed. So I guess it has nothing to do with linux version or configuration. |
i wrote a workaroud cl, https://golang.org/cl/105400043/, as you suggested. can you try this and report back the result? thanks. Status changed to New. |
It may be obvious already, but in case it helps: The initial commit that broke this is this: https://code.google.com/p/go/source/detail?r=5f662f12d550 Reverting the change (against release 1.3) appears to solve the problem for me. Judging from the history this possibly re-instates some other issue though. |
a fix; https://golang.org/cl/120820043/ though, not tested on dragonfly (async-connect enabled platform) yet. |
CL https://golang.org/cl/120820043 mentions this issue. |
This issue was closed by revision c0325f5. Status changed to Fixed. |
Merging with 8426 because the same CL claims to fix both. Status changed to Duplicate. Merged into issue #8426. |
adg
added a commit
that referenced
this issue
May 11, 2015
…oll on linux ««« CL 120820043 / 06a4b59c1393 net: prevent spurious on-connect events via epoll on linux On Linux, adding a socket descriptor to epoll instance before getting the EINPROGRESS return value from connect system call could be a root cause of spurious on-connect events. See golang.org/issue/8276, golang.org/issue/8426 for further information. All credit to Jason Eggleston <jason@eggnet.com> Fixes #8276. Fixes #8426. LGTM=dvyukov R=dvyukov, golang-codereviews, adg, dave, iant, alex.brainman CC=golang-codereviews https://golang.org/cl/120820043 »»» TBR=r, rsc CC=golang-codereviews https://golang.org/cl/128110045
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
On Linux, adding a socket descriptor to epoll instance before getting the EINPROGRESS return value from connect system call could be a root cause of spurious on-connect events. See golang.org/issue/8276, golang.org/issue/8426 for further information. All credit to Jason Eggleston <jason@eggnet.com> Fixes golang#8276. Fixes golang#8426. LGTM=dvyukov R=dvyukov, golang-codereviews, adg, dave, iant, alex.brainman CC=golang-codereviews https://golang.org/cl/120820043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 9, 2018
On Linux, adding a socket descriptor to epoll instance before getting the EINPROGRESS return value from connect system call could be a root cause of spurious on-connect events. See golang.org/issue/8276, golang.org/issue/8426 for further information. All credit to Jason Eggleston <jason@eggnet.com> Fixes golang#8276. Fixes golang#8426. LGTM=dvyukov R=dvyukov, golang-codereviews, adg, dave, iant, alex.brainman CC=golang-codereviews https://golang.org/cl/120820043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by coocood:
The text was updated successfully, but these errors were encountered: