-
Notifications
You must be signed in to change notification settings - Fork 990
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
handle mpsc channel disconnect from peer_write thread #3241
Conversation
also actually shutdown the writer when we say we are going to
Looking good. Some tests are failing. |
LGTM, testing it locally for a bit |
Testing disconnect by turning off wifi on my laptop:
|
Is that the expected behavior @jaspervdm ? |
@jaspervdm that's interesting. Let me take a look at what's going on there. Why would it be |
https://doc.rust-lang.org/std/net/struct.TcpStream.html#method.set_read_timeout
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing as the panic happens on master, approving this PR
Resolves #3237.
Handle the
RecvTimeoutError
when we callrecv_timeout()
to receive messages off the mpsc channel. HandleTimeout
by retrying the loop but handleDisconnected
by stopping and shutting down.https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver.html#method.recv_timeout
We were also never calling
writer.shutdown(Shutdown::Both)
when the write loop terminated and I think we should be doing so (we do it for the read loop).