Skip to content

Commit ed05cf9

Browse files
committed
Set state to Closed when session fails. Fixes #433
1 parent f85ee35 commit ed05cf9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,8 @@ internal void SetFailed(Exception exception)
10261026
Log.Info(exception, "{0} setting state to Failed: {1}", m_logArguments);
10271027
lock (m_lock)
10281028
m_state = State.Failed;
1029+
if (OwningConnection != null && OwningConnection.TryGetTarget(out var connection))
1030+
connection.SetState(ConnectionState.Closed);
10291031
}
10301032

10311033
private void VerifyState(State state)

0 commit comments

Comments
 (0)