-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: Conn.Read() stuck in runtime_pollWait after internet connection loss and recovery #41549
Comments
This is expected if a timeout has not been set on the connection. Has a timeout been set before calling Read? |
So there should probably be a Still, I would expect that a read call (even untimed) would error with "internet disconnected" on internet disconnection, or would unstuck again when the internet connection has recovered, but not just stuck. |
Yup, if it’s important, it needs a timeout.
If the operating system has not signalled that the tcp connection has been closed or reset, there’s not much the runtime can do from user space. |
So you think this is a kernel/Docker problem that it doesn't close the socket on internet disconnection, or no one's problem at all? The runtime could probably detect the internet disconnection event and fail all outstanding Reads. |
the network fd is handled by epoll (on linux) and if there is no event received from the kernel, there's nothing the runtime can do. |
See also #31490 re TCP keepalive problems. TCP keepalive is on by default for both client and server net.Conn's |
/cc @FiloSottile |
Doesn't look like a crypto/tls specific issue, please tag me back in if I'm wrong. |
I don't think there is anything we can change in the Go standard library here, so I'm going to close the issue. Please comment if you disagree. |
What version of Go are you using (
go version
)?go1.15
What operating system and processor architecture are you using (
go env
)?RaspberriPi Compute Module 3+, 4.19.88 #1 SMP Fri Jul 17 09:42:11 UTC 2020 armv7l GNU/Linux.
Additionally, the process runs within a Docker container.
What did you do?
Internet connection broke and then recovered.
tls.Conn.Read() stuck in runtime_pollWait.
Might be related to #27752
The text was updated successfully, but these errors were encountered: