@@ -584,6 +584,10 @@ public async Task<bool> TryResetConnectionAsync(ConnectionSettings cs, IOBehavio
584
584
{
585
585
Log . Debug ( ex , "Session{0} ignoring IOException in TryResetConnectionAsync" , m_logArguments ) ;
586
586
}
587
+ catch ( MySqlException ex ) when ( ex . ErrorCode == MySqlErrorCode . ClientInteractionTimeout )
588
+ {
589
+ Log . Debug ( ex , "Session{0} ignoring ClientInteractionTimeout MySqlException in TryResetConnectionAsync" , m_logArguments ) ;
590
+ }
587
591
catch ( ObjectDisposedException ex )
588
592
{
589
593
Log . Debug ( ex , "Session{0} ignoring ObjectDisposedException in TryResetConnectionAsync" , m_logArguments ) ;
@@ -795,6 +799,10 @@ public async ValueTask<bool> TryPingAsync(bool logInfo, IOBehavior ioBehavior, C
795
799
{
796
800
Log . Debug ( ex , "Session{0} ping failed due to IOException" , m_logArguments ) ;
797
801
}
802
+ catch ( MySqlException ex ) when ( ex . ErrorCode == MySqlErrorCode . ClientInteractionTimeout )
803
+ {
804
+ Log . Debug ( ex , "Session{0} ping failed due to ClientInteractionTimeout MySqlException" , m_logArguments ) ;
805
+ }
798
806
catch ( SocketException ex )
799
807
{
800
808
Log . Debug ( ex , "Session{0} ping failed due to SocketException" , m_logArguments ) ;
@@ -1584,7 +1592,6 @@ private static void SafeDispose<T>(ref T? disposable)
1584
1592
1585
1593
internal void SetFailed ( Exception exception )
1586
1594
{
1587
- m_logArguments [ 1 ] = exception . Message ;
1588
1595
Log . Info ( exception , "Session{0} setting state to Failed" , m_logArguments ) ;
1589
1596
lock ( m_lock )
1590
1597
m_state = State . Failed ;
@@ -1677,7 +1684,10 @@ private Exception CreateExceptionForErrorPayload(ReadOnlySpan<byte> span)
1677
1684
var errorPayload = ErrorPayload . Create ( span ) ;
1678
1685
if ( Log . IsDebugEnabled ( ) )
1679
1686
Log . Debug ( "Session{0} got error payload: Code={1}, State={2}, Message={3}" , m_logArguments [ 0 ] , errorPayload . ErrorCode , errorPayload . State , errorPayload . Message ) ;
1680
- return errorPayload . ToException ( ) ;
1687
+ var exception = errorPayload . ToException ( ) ;
1688
+ if ( exception . ErrorCode is MySqlErrorCode . ClientInteractionTimeout )
1689
+ SetFailed ( exception ) ;
1690
+ return exception ;
1681
1691
}
1682
1692
1683
1693
private void ClearPreparedStatements ( )
0 commit comments