Skip to content

Commit

Permalink
Fix transient fault handling for Pooled connections (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Jul 21, 2020
1 parent ebde504 commit 415262d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -544,6 +544,8 @@ private bool IsTransientError(SqlException exc)
{
if (s_transientErrors.Contains(error.Number))
{
// When server timeouts, connection is doomed. Reset here to allow reconnect.
UnDoomThisConnection();
return true;
}
}
Expand Down Expand Up @@ -1628,7 +1630,7 @@ private bool AttemptRetryADAuthWithTimeoutError(SqlException sqlex, SqlConnectio
timeout.Reset();
// When server timeout, the auth context key was already created. Clean it up here.
_dbConnectionPoolAuthenticationContextKey = null;
// When server timeout, connection is doomed. Reset here to allow reconnect.
// When server timeouts, connection is doomed. Reset here to allow reconnect.
UnDoomThisConnection();
// Change retry state so it only retries once for timeout error.
_activeDirectoryAuthTimeoutRetryHelper.State = ActiveDirectoryAuthenticationTimeoutRetryState.Retrying;
Expand Down
Expand Up @@ -632,6 +632,8 @@ private bool IsTransientError(SqlException exc)
{
if (transientErrors.Contains(error.Number))
{
// When server timeouts, connection is doomed. Reset here to allow reconnect.
UnDoomThisConnection();
return true;
}
}
Expand Down Expand Up @@ -1976,7 +1978,7 @@ private bool AttemptRetryADAuthWithTimeoutError(SqlException sqlex, SqlConnectio
timeout.Reset();
// When server timeout, the auth context key was already created. Clean it up here.
_dbConnectionPoolAuthenticationContextKey = null;
// When server timeout, connection is doomed. Reset here to allow reconnect.
// When server timeouts, connection is doomed. Reset here to allow reconnect.
UnDoomThisConnection();
// Change retry state so it only retries once for timeout error.
_activeDirectoryAuthTimeoutRetryHelper.State = ActiveDirectoryAuthenticationTimeoutRetryState.Retrying;
Expand Down

0 comments on commit 415262d

Please sign in to comment.