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

OnCanCreateNewOutgoingStream in SpdySession #63

Open
martenrichter opened this issue Jan 3, 2024 · 6 comments
Open

OnCanCreateNewOutgoingStream in SpdySession #63

martenrichter opened this issue Jan 3, 2024 · 6 comments

Comments

@martenrichter
Copy link

Hi,
I am trying to make unit test for the MAX_STREAM property in my WebTransport lib.
I ran into an issue, if the number of bidirectional streams is increased the visitor was not informed.
I tracked it down to

void QuicSpdySession::OnCanCreateNewOutgoingStream(bool unidirectional) {

which does not inform in case of bidrectional streams.
The new generic session does it:
void QuicGenericSessionBase::OnCanCreateNewOutgoingStream(bool unidirectional) {

It is not a big deal, since I can overload the method, but I am wondering, if it is intentional and if I am missing something.

@martenrichter
Copy link
Author

martenrichter commented Jan 3, 2024

I have to correct myself; I can not just override the virtual, these session objects are two separate things. But still, the QuicSpdySession, where the code where the call ends after receiving an update. So, I am stuck here and grateful for a pointer on how to pass "OnCanCreateNewOutgoingStream" onto the WebTransportSessionVisitor object.
The "QuicGenericSessionBase" misses the Http3 parsing stuff and can not be used.

@martenrichter
Copy link
Author

@martenrichter
Copy link
Author

martenrichter commented Jan 4, 2024

OK, I could fix it with this:
fails-components/webtransport@4de5fa1
However, it is more a workaround to solve it also in Chromium,
one should go to OnCanCreateNewOutgoingStream in SpdySession and iterate through all its streams, check if it is a WebTransport session stream, and call OnCanCreateNewOutgoingStream.
And, of course, OnCanCreateNewOutgoingStream should be added to the WebTransportSession Object, and the implementation then calls its visitors.

@martenrichter
Copy link
Author

In order to see what the issue is, you can look into the test I have written:
fails-components/webtransport@d3b5ff6
Basically the client creates 150 bidi streams and exhausts the limit of 100 streams (including the session stream, which would be different for http/2). Then it triggers by opening a unidirectional stream (it is misuse as a cheap communication channel), the closure of 51 streams on the server side, which allows the client side to finish the opening of the remaining 51 streams.
However, without a passing OnCanCreateNewOutgoingStream the client side would not progress with the opening as it did not know that it is possible to open streams again. (Although creating another bidirectional stream would have triggered it).
So the tests starved in this case. This is not a very severe bug, but one prone to very bogus race conditions.

@vasilvv
Copy link
Contributor

vasilvv commented Jan 11, 2024

Hi Marten,

You're correct that this is a bug (I'll need to fix this). I think this shouldn't affect the production Chrome APIs, since those are defined to immediately fail whenever you exceed the stream limit, and we don't currently have a way to notify the application that new streams are available (it was recently added to the spec, but isn't implemented in our code yet).

@martenrichter
Copy link
Author

Hi Victor,
ok, yes if Chrome immediately fails, then the deadlock can not occur.
But of course, if you implement the new feature, then it will. (So what I am currently doing.)

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