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] Observe exceptions from _connectionCloseTcs #112190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ManickaP
Copy link
Member

@ManickaP ManickaP commented Feb 5, 2025

Fixes #112094

Observing the exception the same way as channel does in:

if (tcs.TrySetException(error))
{
// Suppress unobserved exceptions from Completion tasks, as the exceptions will generally
// have been surfaced elsewhere (which may end up making a consumer not consume the completion
// task), and even if they weren't, they're created by a producer who will have "seen" them (in
// contrast to them being created by some method call failing as part of user code).
_ = tcs.Task.Exception;
}

Copy link
Contributor

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

@@ -658,14 +658,22 @@ private unsafe int HandleEventShutdownInitiatedByTransport(ref SHUTDOWN_INITIATE
{
Exception exception = ExceptionDispatchInfo.SetCurrentStackTrace(ThrowHelper.GetExceptionForMsQuicStatus(data.Status, (long)data.ErrorCode));
_connectedTcs.TrySetException(exception);
_connectionCloseTcs.TrySetException(exception);
if (_connectionCloseTcs.TrySetException(exception))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we extract it as a method? as it's used 3 times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnobservedTaskException from QuicConnection that has not been disposed
3 participants