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

Stream doesn't get SHUTDOWN_COMPLETE #2048

Closed
nibanks opened this issue Oct 5, 2021 Discussed in #2047 · 1 comment · Fixed by #2049
Closed

Stream doesn't get SHUTDOWN_COMPLETE #2048

nibanks opened this issue Oct 5, 2021 Discussed in #2047 · 1 comment · Fixed by #2049
Labels
Bug: Core A code bug in the Core MsQuic code
Milestone

Comments

@nibanks
Copy link
Member

nibanks commented Oct 5, 2021

Discussed in #2047

Originally posted by ManickaP October 5, 2021
Client finished sending and gets SEND_SHUTDOWN_COMPLETE, then it calls ABORT_READ, and GRACEFUL StreamShutdown, yet it never receives SHUTDOWN_COMPLETE (until the connection gets closed minutes later).

On the server side, the stream shutdowns properly (receiving SHUTDOWN_COMPLETE) and destroys itself.

Attaching msquic.log extract.

And here's the sequence of shutdown calls from the client logs:

21:05:04.4342388[Info] thisOrContextObject: State#21233793, memberName: StartShutdown, message: [strm][0x7F37440A3120] Stream StartShutdown flags=ABORT_RECEIVE error=268
21:05:04.4342554[Info] thisOrContextObject: State#21233793, memberName: StartShutdown, message: [strm][0x7F37440A3120] Stream StartShutdown flags=GRACEFUL error=0
21:05:04.4342595[Info] thisOrContextObject: State#21233793, memberName: StartShutdown, message: [strm][0x7F37440A3120] Stream StartShutdown flags=ABORT_RECEIVE error=4294967295

Are we doing something wrong?

Converting to an issue since it's a real bug.

@nibanks nibanks added the Bug: Core A code bug in the Core MsQuic code label Oct 5, 2021
@nibanks nibanks added this to the Nickel milestone Oct 5, 2021
@nibanks
Copy link
Member Author

nibanks commented Oct 5, 2021

So the problem is that an endpoint that sends a STOP_SENDING (i.e. aborts a receive) needs to handle the case where the peer never sends a RESET_STREAM and instead relies on the FIN. The code mostly handled this already, but there is a case where it does not.

The fix is to update the stream receive logic to not simply ignore all STREAM frames after abort. Instead, it must look for FINs and essentially treat them as a reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Core A code bug in the Core MsQuic code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant