Skip to content

Commit

Permalink
[Release/2.0] Fix transient fault handling for Pooled connections (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Jul 21, 2020
1 parent 2881d67 commit d9999d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,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 @@ -1629,7 +1631,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
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,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 @@ -1977,7 +1979,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 d9999d6

Please sign in to comment.