Skip to content

[QUIC] Cosmetic changes to Read pipeline - #55591

Merged
CarnaViire merged 1 commit into
dotnet:mainfrom
CarnaViire:read-pr-cosmetic-followup
Jul 14, 2021
Merged

[QUIC] Cosmetic changes to Read pipeline#55591
CarnaViire merged 1 commit into
dotnet:mainfrom
CarnaViire:read-pr-cosmetic-followup

Conversation

@CarnaViire

Copy link
Copy Markdown
Member

Follow-up for NITs and cosmetic changes from #55505

@ghost

Copy link
Copy Markdown

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
Copy Markdown

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:-

@ManickaPManickaP left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Love the comments ❤️

initialReadState = ReadState.Aborted;
_state.ReadState = ReadState.Aborted;
canceledSynchronously = true;
preCanceled = true;

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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:mainJul 14, 2021
@CarnaViire
CarnaViire deleted the read-pr-cosmetic-followup branch July 14, 2021 14:00
@karelzkarelz added this to the 6.0.0 milestone Jul 15, 2021
@ghostghost locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for freeto 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

@CarnaViire@ManickaP@karelz