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

Temporary fix for merge retries #3326

Merged
merged 1 commit into from
Jun 4, 2023
Merged
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 @@ -15,7 +15,8 @@ internal static bool IsRetriable(this Exception e)
|| HasInternalSqlErrorPattern(str)
|| HasDatabaseAvailabilityPattern(str)
|| HasDatabaseOverloadPattern(str)
|| HasDeadlockErrorPattern(str);
|| HasDeadlockErrorPattern(str)
|| HasReaderOnClosedConnectionPattern(str);
}

internal static bool IsExecutionTimeout(this Exception e)
Expand Down Expand Up @@ -103,5 +104,11 @@ private static bool HasDatabaseOverloadPattern(string str)

////The request limit for the database is 200 and has been reached.
}

// TODO: This is temporary until transactions are removed from CSharp code, and we start using correct retry logic on merge.
private static bool HasReaderOnClosedConnectionPattern(string str)
{
return str.Contains("BeginExecuteReader requires an open and available Connection", StringComparison.OrdinalIgnoreCase) && str.Contains("current state is closed", StringComparison.OrdinalIgnoreCase);
}
}
}