-
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
Fix exception thrown when MsQuicStream write direction is locally aborted or canceled #67753
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes #67612. The issue with the original code was that when
|
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.
One question, otherwise LGTM, thanks!
@@ -376,7 +378,7 @@ private CancellationTokenRegistration HandleWriteStartState(bool emptyBuffer, Ca | |||
throw new QuicStreamAbortedException(_state.SendErrorCode); | |||
} | |||
|
|||
throw new OperationCanceledException(SR.net_quic_sending_aborted); | |||
throw new QuicOperationAbortedException(); |
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.
Any reason for not providing a message here?
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.
no reason, I forgot to put it there when copying
Looks like this will not be so simple, the stream conformance tests are failing
|
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
It seems we need to change the exception after canceling @ManickaP can you please review again? |
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.
LGTM, thanks!
The failing test is unrelated ( |
Fixes #67612.
The issue with the original code was that when
MsQuicStream
s write direction was locally aborted, subsequentWriteAsync
calls threwOperationCanceledException
which does not make sense since the associatedCancellationToken
was not expired (or wasn't even cancellable for that matter).This PR changes that behavior to throw
QuicOperationAbortedException
instead, which is in line with #55619.Also, when a
WriteAsync
call si canceled (either during actual write or pre-canceled), subsequent (non-pre-canceled) operations now throwQuicOperationAbortedException
like we do on the reading side of the stream.