Make sure to release connection lock (#11049)

This commit is contained in:
Mikael Mengistu 2019-06-10 15:38:07 -07:00 committed by GitHub
parent f76be64e5d
commit ecd709eb9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -1942,12 +1942,14 @@ namespace Microsoft.AspNetCore.SignalR.Client
return _connectionLock.Wait(0);
}
// Don't call this method in a try/finally that releases the lock since we're also potentially releasing the connection lock here.
public async Task<ConnectionState> WaitForActiveConnectionAsync(string methodName, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = 0)
{
await WaitConnectionLockAsync(methodName);
if (CurrentConnectionStateUnsynchronized == null || CurrentConnectionStateUnsynchronized.Stopping)
{
ReleaseConnectionLock(methodName);
throw new InvalidOperationException($"The '{methodName}' method cannot be called if the connection is not active");
}

View File

@ -770,7 +770,6 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
}
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2465", FlakyOn.All)]
[MemberData(nameof(HubProtocolsAndTransportsAndHubPaths))]
[LogLevel(LogLevel.Trace)]
public async Task CanCancelIAsyncEnumerableClientToServerUpload(string protocolName, HttpTransportType transportType, string path)