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

When should a client initiated unidirectional stream be available on the server side? #618

Open
martenrichter opened this issue Sep 14, 2024 · 3 comments
Labels
Discuss at next meeting Flags an issue to be discussed at the next WG working Ready for PR

Comments

@martenrichter
Copy link

I am still trying to create working stream-limit tests with all two webtransport enabled browsers.
I ran into another issue: I misused creating uni- and bidirectional streams as a matter of communication/synchronization in the tests. Chrome and Firefox behave quite differently.
If I create a unidirectional stream with

await transport.createUnidirectionalStream()

Chromium immediately sends out a frame indicating the stream's creation, but Firefox does not (at least for 5 seconds).
I had to push one byte into the unidirectional stream to let the server know about the stream.
So the question is, is the behavior within spec? If not, I would file a bug with Firefox, and if yes, I think this can lead to trouble...

@martinthomson
Copy link
Member

I think that I see what is happening. Firefox waits until you have something to send. That's pretty reasonable, in my view. No point in burning the resources until you need to use the stream.

In a protocol that uses QUIC directly, you don't see a stream creation at the receiving end until some data is sent.

Chrome is getting the sending out of the way, which might be better in some ways, even if that leads to more overhead.

Both are entirely valid.

@martenrichter
Copy link
Author

I think that I see what is happening. Firefox waits until you have something to send.
That is also my conclusion. Only bidirectional streams are opened immediately, which makes sense but is different. I do not understand Firefox code entirely yet and did not identify where it is handled differently.

That's pretty reasonable, in my view. No point in burning the resources until you need to use the stream.

In a protocol that uses QUIC directly, you don't see a stream creation at the receiving end until some data is sent.

Chrome is getting the sending out of the way, which might be better in some ways, even if that leads to more overhead.

Both are entirely valid.
The question is, would it be desirable to have consistent behavior across browsers?

Ok, the test I am writing is a bit artificial, but in the case of the test that surfaced the different behavior, it took me a few days to find one cause the test is not running through (it runs without problems using my quiche-based client). However, I am debugging both sides of the C++ (or Rust) code with debuggers, debug printouts, etc. . If a developer-only with javascript knowledge on the UA side and some scripting language on the server side (either node.js or comparable) tries to find the differences, it may take considerable time.

If the different behavior remains, I would think a hint in the spec and may be here: https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream would be good for future developers.

@wilaw wilaw added the Discuss at next meeting Flags an issue to be discussed at the next WG working label Oct 7, 2024
@wilaw wilaw added this to the Candidate Recommendation milestone Oct 7, 2024
@jan-ivar
Copy link
Member

jan-ivar commented Oct 8, 2024

Meeting:

  • Add Note: Until data is sent on a stream there's no expectation that the recipient will be aware of stream creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discuss at next meeting Flags an issue to be discussed at the next WG working Ready for PR
Projects
None yet
Development

No branches or pull requests

4 participants