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: Standardize exception meaning and behavior #55619

Closed
geoffkizer opened this issue Jul 14, 2021 · 3 comments
Closed

QUIC: Standardize exception meaning and behavior #55619

geoffkizer opened this issue Jul 14, 2021 · 3 comments
Assignees
Milestone

Comments

@geoffkizer
Copy link
Contributor

I was talking with @JamesNK today about this. He's trying to figure out what exceptions can be thrown from what methods in what circumstances.

I think we need to
(a) Clarify exception meaning and usage
(b) Document what exceptions can happen when
(c) Ensure we have tests that validate this behavior.

Here's my quick attempt to define things as I understand them, please add/comment:

QuicStreamAbortedException should happen when the peer has aborted the stream (and we should always have an error code)
QuicConnectionAbortedException should happen when the peer has aborted the connection (and we should always have an error code)
QuicOperationAbortedException should happen when you do something that results in a local operation being aborted, e.g. AbortRead (or close Stream or close Connection) with a pending Read
OperationCanceledException should happen when the cancellation token for a particular call fires, and it should always contain the relevant cancellation token
ObjectDisposedException should happen when the object is disposed or closed (with a few exception, like calling dispose again)
TBD: What should happen when “shutdown by transport” occurs? In this case, the connection is dead but we have no error code to report.
TBD: What should happen if you try to e.g. Read after AbortRead, or Write after AbortWrite, or Write after CompleteWrites?
TBD: What should happen if you call AbortRead when read is already aborted, either locally or by peer? Similarly for AbortWrite and CompleteWrites
TBD: Exception behavior for other methods, e.g. AcceptStream/Connection, WaitForAvailableStreams, etc.

@geoffkizer geoffkizer added this to the 6.0.0 milestone Jul 14, 2021
@ghost
Copy link

ghost commented Jul 14, 2021

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

Issue Details

I was talking with @JamesNK today about this. He's trying to figure out what exceptions can be thrown from what methods in what circumstances.

I think we need to
(a) Clarify exception meaning and usage
(b) Document what exceptions can happen when
(c) Ensure we have tests that validate this behavior.

Here's my quick attempt to define things as I understand them, please add/comment:

QuicStreamAbortedException should happen when the peer has aborted the stream (and we should always have an error code)
QuicConnectionAbortedException should happen when the peer has aborted the connection (and we should always have an error code)
QuicOperationAbortedException should happen when you do something that results in a local operation being aborted, e.g. AbortRead (or close Stream or close Connection) with a pending Read
OperationCanceledException should happen when the cancellation token for a particular call fires, and it should always contain the relevant cancellation token
ObjectDisposedException should happen when the object is disposed or closed (with a few exception, like calling dispose again)
TBD: What should happen when “shutdown by transport” occurs? In this case, the connection is dead but we have no error code to report.
TBD: What should happen if you try to e.g. Read after AbortRead, or Write after AbortWrite, or Write after CompleteWrites?
TBD: What should happen if you call AbortRead when read is already aborted, either locally or by peer? Similarly for AbortWrite and CompleteWrites
TBD: Exception behavior for other methods, e.g. AcceptStream/Connection, WaitForAvailableStreams, etc.

Author: geoffkizer
Assignees: -
Labels:

area-System.Net.Quic

Milestone: 6.0.0

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 14, 2021
@karelz
Copy link
Member

karelz commented Jul 15, 2021

Triage: We should at least have a plan in 6.0, then see if there is work which must-have for 6.0.

@rzikm
Copy link
Member

rzikm commented Jul 15, 2022

Fixed by #70669.

@rzikm rzikm closed this as completed Jul 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants