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

runtime: sockets closed by remote peer may remain undetected by poller #6753

Open
remyoudompheng opened this issue Nov 12, 2013 · 5 comments
Milestone

Comments

@remyoudompheng
Copy link
Contributor

I have observed a network TCP server blocked on a Write although the client (Go program
located on a remote machine) has closed the connection.

So far I have been unable to produce a minimal reproducer.

My hypothesis is that the poller is not handling EPOLLRDHUP correctly. map epoll_ctl(2)
says that it means: "Stream socket peer closed connection, or shut down writing
half of  connection."
But when obtaining EPOLLRDHUP from the socket the poller wakes up WaitRead() but not
WaitWrite(), so if the EPOLLRDHUP was generated by a remote close, waiting writers will
never wake up (one would expect something like "connection reset by peer").

Using linux/amd64.
@dvyukov
Copy link
Member

dvyukov commented Nov 14, 2013

Comment 1:

Writes must not be unblocked/prohibited after EPOLLRDHUP, writing is exactly what server
is supposed to do after EPOLLRDHUP (shutdown(SHUT_WR) on client).
If the client does close(fd), then the server receives EPOLLRDHUP | EPOLLHUP | EPOLLERR,
so writes must be unblocked.
So far I do not see where the problem is. Do you use CloseRead/CloseWrite?

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 2:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added repo-main.

@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@methane
Copy link
Contributor

methane commented Feb 13, 2019

ref: #15735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants