-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(yamux): increase max number of buffered inbound streams to 256 #3872
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,11 @@ pub struct Muxer<S> { | |
| inbound_stream_waker: Option<Waker>, | ||
| } | ||
|
|
||
| const MAX_BUFFERED_INBOUND_STREAMS: usize = 25; | ||
| /// Yamux does not have any built-in backpressure mechanism. | ||
| /// | ||
| /// Implementations are encouraged to not open more than 256 unacknowledged streams, see <https://github.com/libp2p/specs/tree/master/yamux#ack-backlog>. | ||
| /// Thus, it makes sense to buffer up to 256 streams before dropping them for good interoperability. | ||
| const MAX_BUFFERED_INBOUND_STREAMS: usize = 256; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure I follow the reasoning above. At the point where a new stream is retrieved through As far as I can tell, bumping this limit just delays running into the limit itself, no?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for questioning this!
I don't think this is true. We emit streams in The first payload will be I think it makes sense to write a test against this just to be sure but for that we land the ACK backlog changes first: libp2p/rust-yamux#150
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the Let me know if you see anything wrong with the reasoning here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realized I still had a fully-working branch for the ACK backlog locally so I just quickly added a test for this as well and it confirmed my intuition: libp2p/rust-yamux#153 |
||
|
|
||
| impl<S> fmt::Debug for Muxer<S> { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.