-
Notifications
You must be signed in to change notification settings - Fork 545
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
Support Delaying Stream ID FC Updates to StreamClose #3665
Conversation
src/core/stream.c
Outdated
@@ -593,7 +607,9 @@ QuicStreamTryCompleteShutdown( | |||
// | |||
// Indicate the stream is completely shut down to the connection. | |||
// | |||
QuicStreamSetReleaseStream(&Stream->Connection->Streams, Stream); | |||
if (!Stream->Flags.DelayFCUpdate || Stream->Flags.HandleClosed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If HandleClose == true, this function, QuicStreamTryCompleteShutdown
, is called by QuicStreamClose
, right? QuicStreamClose
guarantees that QuicStreamSetReleaseStream
will be called if DelayFCUpdate
is set. Wouldn't we end up calling QuicStreamSetReleaseStream
twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is tricky. If an app shuts down (abortively) a stream using the QUIC_STREAM_SHUTDOWN_FLAG_IMMEDIATE
flag then we will immediately give them the shutdown complete event and they can close the handle, but MsQuic will continue to track the stream until we've delivered (and received the ACK for) the corresponding stream frames over the wire. In this case, the QuicStreamClose
call will run before this code path, but we don't want to release the stream there. Later, when everything is complete, this code path will be run finally, but since the handle has already been closed, we need to release the stream now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Description
Sometimes apps might want to delay the stream ID FC updates to StreamClose if they intend on doing significant work between SHUTDOWN_COMPLETE and the close call.
Testing
Updated spinquic.
Documentation
Updated.