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

aggressive open_bi #1846

Closed
szguoxz opened this issue May 3, 2024 · 1 comment
Closed

aggressive open_bi #1846

szguoxz opened this issue May 3, 2024 · 1 comment

Comments

@szguoxz
Copy link

szguoxz commented May 3, 2024

Streams are cheap and instantaneous to open unless blocked by flow control. As a consequence, the peer won’t be notified that a stream has been opened until the stream is actually used.

This feature causes me a bug, and took me hours to figure out.
The work around for me is to send a u8 when open_bi and read_u8 after accept_bi. If I don't do it, my accept_bi will got stuck.

Then I start to question of this design. Or, should we have an easy way to open an aggressive bi channel? So I don't have to do the write_u8, read_u8 hack?

@Ralith
Copy link
Collaborator

Ralith commented May 3, 2024

This is how QUIC works. The side which will first transmit on a stream should be the side responsible for opening it. This will be more prominently documented in the next release:

/// **Important Note**: The `Connection` that calls [`open_bi()`] must write to its [`SendStream`]
/// before the other `Connection` is able to `accept_bi()`. Calling [`open_bi()`] then
/// waiting on the [`RecvStream`] without writing anything to [`SendStream`] will never succeed.

/// # Common issues
///
/// ## Data never received on a locally-opened stream
///
/// Peers are not notified of streams until they or a later-numbered stream are used to send
/// data. If a bidirectional stream is locally opened but never used to send, then the peer may
/// never see it. Application protocols should always arrange for the endpoint which will first
/// transmit on a stream to be the endpoint responsible for opening it.

@Ralith Ralith closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
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

No branches or pull requests

2 participants