Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net: Listener sometimes accepts connections after Close #13762
I've written a repro test here:
It basically does the following:
On the listener side, I expect to receive at most
This works as expected on OSX, but on Linux, it seems to receive a successful connection after the listener has been closed.
Some things I noticed:
I would expect that a Listener will not accept any further socket attempts after
@mikioh I saw #10527, but I think this is a little different. #10527 is basically that the socket isn't closed since
In this case,
changed the title
net: Listener sometimes accepts connections after Close on Linux
Dec 29, 2015
To conclude, this is a duplicate of #10527. In general this may happen when the shared fdMutex in TCPListener is taken by acceptor goroutine prior to TCPListener.Close like the following:
See #10527 for further information.
referenced this issue
Dec 29, 2015
@mikioh Ah, I thought that perhaps Accept would check whether the socket was marked as Closed but that doesn't affect epoll from accepting new connections.
It looks like the other issue has not had any progress since it was last marked as possibly for go 1.5. Can #10527 be prioritized for go 1.7? Thanks