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

Respect mux.ErrReset in all Multiplexer implementations. #814

Closed
Wondertan opened this issue Feb 28, 2020 · 1 comment
Closed

Respect mux.ErrReset in all Multiplexer implementations. #814

Wondertan opened this issue Feb 28, 2020 · 1 comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@Wondertan
Copy link
Contributor

Background

Currently, relying on mux.ErrReset is not helpful and even useless, while cases for handling it do exist. Allmost all the mux.MuxedStream implementations return their own errors after Reset() or any internal connection issues:

Only mplex returns mux.ErrReset, but that forces go-mplex to depend on go-libp2p-core (libp2p/go-yamux#6)

In addition, it might be helpful to define mux.ErrClosed to be returned on Write() after Close(), but it seems irrelevant cause of libp2p/go-libp2p-core#10

Resolving

All the listed multiplexers(except mocknet) have libp2p wrappers based in their own repos, so the solution is to redefine stream types in libp2p wrapping repos with checks of internal reset error to be replaced with mux.ErrReset, while mocknet may use it directly. Also, muxer testing suite should be updated to test for mux.ErrReset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants