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] Cosmetic changes to Read pipeline #55591

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

CarnaViire
Copy link
Member

Follow-up for NITs and cosmetic changes from #55505

@ghost
Copy link

ghost commented Jul 13, 2021

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

Issue Details

Follow-up for NITs and cosmetic changes from #55505

Author: CarnaViire
Assignees: -
Labels:

area-System.Net

Milestone: -

@ghost
Copy link

ghost commented Jul 13, 2021

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

Issue Details

Follow-up for NITs and cosmetic changes from #55505

Author: CarnaViire
Assignees: ManickaP
Labels:

area-System.Net.Quic

Milestone: -

Copy link
Member

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

abortError = _state.ReadErrorCode;

if (readState != ReadState.PendingRead && cancellationToken.IsCancellationRequested)
// Failure scenario: pre-canceled token. Transition: any -> Aborted
Copy link
Member

Choose a reason for hiding this comment

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

Love the comments ❤️

_state.ReadState = ReadState.Aborted;
canceledSynchronously = true;
preCanceled = true;
Copy link
Member

Choose a reason for hiding this comment

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

Why don't directly return new OperationCanceledException(cancellationToken) here and get rid of preCanceled local var. We wouldn't even need to change the initialReadState if I'm reading the code correctly.

Copy link
Member Author

Choose a reason for hiding this comment

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

To do all the work on exceptions in one place and outside of the lock

@CarnaViire CarnaViire merged commit 7cfa945 into dotnet:main Jul 14, 2021
@CarnaViire CarnaViire deleted the read-pr-cosmetic-followup branch July 14, 2021 14:00
@karelz karelz added this to the 6.0.0 milestone Jul 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants