Skip to content

Conversation

@privacyguard
Copy link
Contributor

Gracefully handle remote stream closure

Description

This PR fixes the UnexpectedEOFError issue. This issue happens because the ping protocol does not handle the case where the remote peer closes the stream and with the introduction of connectionMonitor this became an issue. It opens a stream for the ping protocol, sends a ping, gets the response then closes the stream. The local peer throws an exception and triggers a yamux reset.

Notes & open questions

We only tested these changes in the context described above. Not sure if there are other cases to handle.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@privacyguard privacyguard requested a review from a team as a code owner November 13, 2024 14:17
@achingbrain
Copy link
Member

Thanks for opening this. I think we should handle the case where the remote has pinged us and closed the connection, it's in the spec so we shouldn't be logging error messages.

I can't push changes to this branch (possibly due to your org settings) so I've opened #2822 which incorporates the commit from here.

@achingbrain
Copy link
Member

Closing in favour of #2822

@privacyguard
Copy link
Contributor Author

@achingbrain no worries! Glad we could help.

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

Successfully merging this pull request may close these issues.

2 participants