-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Swallow ObjectDisposedException when aborting QuicStream from CancellationAction #74634
Merged
rzikm
merged 1 commit into
dotnet:main
from
rzikm:73688-QUIC-Abort-on-cancellation-throws-QUIC_STATUS_INVALID_PARAMETER
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm wondering if we can have private version of
stream.Abort
that does not throw and either is silent or returnsbool
for tracing if we ant to know ifAbort
succeeded or not.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.
Abort already tries to be no-op in case stream is disposed. But it is not enough. The only way to fix that I can think of, is to do dangerousAddRef in the beginning of Abort, and only after that check _disposed. Or wrap both msquic abort call and dispose of the handle in the lock and check _disposed inside the lock before abort. Otherwise, by the time we access handle on msquic abort call, it might get disposed already, despite the check in the beginning of Abort.
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.
So the ODE would come from the SafeHandle? I'm fine with this change for 7.0. It seems to cause lot of CI troubles. We can figure later if there is cheaper way to do it.
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.
The
ObjectDisposedException
is coming fromDangerousAddRef
. At the moment I see no way of avoiding the exception without a lock (we don't haveTryAddRef
or similar). I expect the exception to be relatively rare so I think it is fine (at least for now)