-
Notifications
You must be signed in to change notification settings - Fork 18k
net: TestDialTimeoutFDLeak failure #4384
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
Milestone
Comments
a few more manifestations: --- FAIL: TestDialTimeoutFDLeak-51 (0.51 seconds) dial_test.go:260: 134 good connects; expected at most 133 pollServer WaitFD: epoll_wait: bad file descriptor FAIL --- FAIL: TestDialTimeoutFDLeak-33 (0.51 seconds) dial_test.go:260: 134 good connects; expected at most 133 dial_test.go:260: 135 good connects; expected at most 133 dial_test.go:260: 136 good connects; expected at most 133 pollServer WaitFD: epoll_wait: bad file descriptor FAIL |
This doesn't surprise me, given my comment here: maxGoodConnect := listenerBacklog + 5 // empirically 131 good ones (of 128). who knows? Mikioh, what is your machine's /proc/sys/net/core/somaxconn value? I don't understand why we're able to connect more than SOMAXCONN anyway (the listener backlog we use), considering we never call Accept. Help wanted. |
% cat /proc/sys/net/core/somaxconn 512 % uname -a Linux vm2 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux I guess, somaxconn is just the threshold to accept function; I mean it affects max # of queue that keeps incoming SYN-SENT sockets during LISTEN and SYN-RECEIVED or ESTABLISHED state. That means that we should make mock TCP sender that can delay last SYN sending if we need more accurate test. Long live 3-way handshaking. |
Sorry for the confusion, I misunderstood. Q. How related TCP listener's backlog to SOMAXCONN A. Linux counts # of ESTABLISHED incoming sockets as backlog. cf. tcp_v4_conn_request in net/ipv4/tcp_ipv4.c: /* Accept backlog is full. If we have already queued enough * of warm entries in syn queue, drop request. It is better than * clogging syn queue with openreqs with exponentially increasing * timeout. */ if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) goto drop; Other BSDs doesn't, it counts both SYN-SENT and ESTABs. Not sure for Windows. Q. Why we're able to connect more than SOMAXCONN on Linux? A. Because latest Linux on multicare/SMP works great on lock-contention!? Hi fullung, which kernel version are you using? I failed to repro the issue on 3.2.0-32-generic Ubuntu. |
While I was looking into this, I ran into another problem: #!/bin/bash set -xe go test -c net while true; do GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]] ./net.test -test.run=TestAddFDReturnsError -test.timeout=10s done TestAddFDReturnsError seems to hang every few hundred runs... Should I file a new bug? |
I copied Dave Cheney on this bug to look into Comment 12 while he works on the poll server code. But yes, that's probably another bug. Or add this info to issue #4434. |
TestAddFDReturnsError failure is issue #4423. |
https://golang.org/cl/6923046 fullung: can you please test, with note to the alternative suggestion in the CL. Owner changed to @davecheney. Status changed to Started. |
This issue was closed by revision 4766a35. Status changed to Fixed. |
This issue was closed by revision feb509c. |
mikioh
pushed a commit
that referenced
this issue
Apr 3, 2015
This change makes TestDialTimeoutFDLeak work on almost all the supported platforms. Updates #4384. Change-Id: I3608f438003003f9b7cfa17c9e5fe7077700fd60 Reviewed-on: https://go-review.googlesource.com/8392 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: