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

[release/6.0] HTTP/3: Abort connection on unexpected exception from AcceptStream #37461

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,24 @@ public override void Abort(ConnectionAbortedException abortReason)
// Throw error so consumer sees the connection is aborted by peer.
throw new ConnectionResetException(ex.Message, ex);
}
catch (QuicOperationAbortedException)
catch (QuicOperationAbortedException ex)
{
// Shutdown initiated by us.

lock (_shutdownLock)
{
// Connection has been aborted. Throw reason exception.
_abortReason?.Throw();
// This error should only happen when shutdown has been initiated by the server.
// If there is no abort reason and we have this error then the connection is in an
// unexpected state. Abort connection and throw reason error.
if (_abortReason == null)
{
Abort(new ConnectionAbortedException("Unexpected error when accepting stream.", ex));
}

_abortReason!.Throw();
}
}
catch (OperationCanceledException)
{
// Shutdown initiated by us.
Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested.");

lock (_shutdownLock)
{
Expand Down