-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
EnableRetryOnFailure defaults don't cover SQL Azure recommended retry period #8275
Comments
@AndriySvyryd Any comments on this? |
I think it would be reasonable to bump up the default retry count to 6 to match the current recommendation. |
Ok, that's all understandable. Although... this is the first time I've come across one of these "transient" problems with SQL Azure*, and out-of-the-box, the flag which I assumed was designed for this kind of cloud scenario, didn't cover the right timeout period, or cover the type of error I encountered. I understand if it's not a part of the plan (though it would be a plus, depending on other priorities). But maybe it should be possible, maybe documented? Is there a way I can configure a retry on connection failure? I'm not sure how SQL Azure/EF's SQL client responds to connection failures. It could be that it automatically retries within the timeout. If that's what you're telling me, sorry - I'll just increase the timeout. :) (* - I can only assume this is a transient error: I wasn't reconfiguring it at the time etc) |
@kierenj We do retry on failure during the connection opening, but the exception you got is not considered retryable because it's generated on the client side and you have a different mechanism to set the timeout there. |
Increase retries to cover one minute. |
The
EnableRetryOnFailure
method defaults to 5 retries, max delay 30 sec, which the code comments indicate give a ~26sec total retry duration.The SQL Azure "dealing with transient errors" documentation indicates that transient problems may list up to 1 minute. (https://docs.microsoft.com/en-us/azure/sql-database/sql-database-troubleshoot-common-connection-issues)
Should the default for
EnableRetryOnFailure
cover this duration?Additionally, I found this when checking my context config code. I have
EnableRetryOnFailure
, but received a load of a connection timeout exceptions with the below text, on SQL Azure, last night at around midnight:(added some newlines for readability)
Forgive me for rolling two questions into one issue - but does this indicate that a) it retried as a part of opening this connection, but the problem took more than the 5 default retries, b) that EF Core doesn't retry this type of connection-open operation, c) that it should, but I've probably misconfigured something?
Thanks!
The text was updated successfully, but these errors were encountered: