Skip to content

Conversation

martincostello
Copy link
Member

@martincostello martincostello commented Jan 30, 2022

Add missing ConfigureAwait(false)

Add missing ConfigureAwait(false) on task await.

Description

Add missing ConfigureAwait(false) on task await in PolicyHttpMessageHandler.

Looks like this got overlooked in #36162 when async was added to the method.

Add missing ConfigureAwait(false) on task await.
Add EditorConfig file to catch future occurrences.
@ghost ghost added area-runtime community-contribution Indicates that the PR has been added by a community member labels Jan 30, 2022
[*.{cs,vb}]

# CA2007: Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = warning
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we leave this file out? I'd like to see if we can enable this rule at the global level and make it a non-warning for projects that are part of ASP.NET Core / reference the shared fx?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can take it out if you like - I'd added it based on #39865 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please. I might give it a go this week. FYI @BrennanConroy

Copy link
Member

Choose a reason for hiding this comment

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

if we can enable this rule at the global level and make it a non-warning for projects that are part of ASP.NET Core / reference the shared fx

Sounds good, didn't know you were planning on doing this 👍

Remove based on PR feedback.
@Tratcher Tratcher merged commit fbfb11e into dotnet:main Jan 31, 2022
@ghost ghost added this to the 7.0-preview1 milestone Jan 31, 2022
@Tratcher
Copy link
Member

Thanks

@martincostello martincostello deleted the Add-Missing-ConfigureAwait branch January 31, 2022 18:10
@wtgodbe wtgodbe modified the milestones: 7.0-preview1, 7.0-preview2 Jan 31, 2022
@wjrogers
Copy link

@martincostello is there any chance this fix can be backported to 6.0? My team just hit a deadlock using Polly in our WinForms app because of this missing ConfigureAwait(false).

@ghost
Copy link

ghost commented May 11, 2022

Hi @wjrogers. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@martincostello
Copy link
Member Author

@wjrogers That's a question for the ASP.NET Core team, not me 😄

@ghost
Copy link

ghost commented May 11, 2022

Hi @martincostello. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants