Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transient fault handling for Pooled connections #637

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,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 @@ -1610,7 +1612,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 @@ -620,6 +620,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 @@ -1960,7 +1962,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