-
Notifications
You must be signed in to change notification settings - Fork 10.4k
.ConfigureAwait(false) in SignalR client libraries #39728
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
Conversation
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.
👍🏽 We should also consider enabling this for things that aren't exclusively ASP.NET Core (e.g. DataProtection, Extensions.Features, JSInterop etc).
@@ -2090,6 +2091,90 @@ await using (var server = await StartServer<Startup>(ExpectedErrors)) | |||
} | |||
} | |||
|
|||
[Theory] | |||
[MemberData(nameof(TransportTypes))] | |||
public async Task CanBlockOnAsyncOperationsWithOneAtATimeSynchronizationContext(HttpTransportType transportType) |
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.
I thought we had tests like this before, but looks like they never got merged 😮
aspnet/SignalR#792
Why are we using ConfigureAwait on the server side? |
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
Outdated
Show resolved
Hide resolved
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
Outdated
Show resolved
Hide resolved
0be456d
to
7cfaf05
Compare
Fixed. |
.ConfigureAwait(false)
in SignalR client librariesCA2007
(Consider calling ConfigureAwait on the awaited task) for SignalR client libraries and shared librariesForceAsync()
in ignalR client libraries and shared librariesForceAsync()
could still cause deadlocks of the code using the client tried to block a UI thread (or any one-at-a-timeSynchronizationContext
) because internal SignalR logic would try to post back to it.Fixes #39626
Partially addresses #31132