Skip to content

Commit 0ff5b05

Browse files
committed
CSHARP-2005: Invalid BinaryConnection state transition from 4 to Failed.
1 parent 70c012c commit 0ff5b05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MongoDB.Driver.Core/Core/Connections/BinaryConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ public void FailedOpeningConnection(Exception wrappedException)
675675
if (!_connection._state.TryChange(State.Connecting, State.Failed) && !_connection._state.TryChange(State.Initializing, State.Failed))
676676
{
677677
var currentState = _connection._state.Value;
678-
if (currentState != State.Disposed)
678+
if (currentState != State.Failed && currentState != State.Disposed)
679679
{
680680
throw new InvalidOperationException($"Invalid BinaryConnection state transition from {currentState} to Failed.");
681681
}

0 commit comments

Comments
 (0)