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

QUIC: ShutdownCompleted cancellation token does not actually cancel the call #55706

Closed
geoffkizer opened this issue Jul 15, 2021 · 2 comments · Fixed by #55993
Closed

QUIC: ShutdownCompleted cancellation token does not actually cancel the call #55706

geoffkizer opened this issue Jul 15, 2021 · 2 comments · Fixed by #55993
Assignees
Milestone

Comments

@geoffkizer
Copy link
Contributor

We register for cancellation here, but even if the registration fires, we don't actually do anything to cancel the ShutdownCompletionSource.

@geoffkizer geoffkizer added this to the 6.0.0 milestone Jul 15, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 15, 2021
@ghost
Copy link

ghost commented Jul 15, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

We register for cancellation here, but even if the registration fires, we don't actually do anything to cancel the ShutdownCompletionSource.

Author: geoffkizer
Assignees: -
Labels:

area-System.Net.Quic

Milestone: 6.0.0

@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Jul 15, 2021
@CarnaViire
Copy link
Member

CarnaViire commented Jul 15, 2021

You mean to let msquic know about that, i.e. to call for an immediate abortive shutdown?

Update:
Ah, I see, we touch on the wrong completion source here

using CancellationTokenRegistration registration = cancellationToken.UnsafeRegister(static (s, token) =>
{
var state = (State)s!;
bool shouldComplete = false;
lock (state)
{
if (state.ShutdownState == ShutdownState.None)
{
state.ShutdownState = ShutdownState.Canceled;
shouldComplete = true;
}
}
if (shouldComplete)
{
state.ShutdownWriteCompletionSource.SetException(
ExceptionDispatchInfo.SetCurrentStackTrace(new OperationCanceledException("Wait for shutdown was canceled", token)));
}
}, _state);

This looks like a copy-paste bug, it should be ShutdownCompletionSource

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 20, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants