Skip to content

EnableRetryOnFailure defaults don't cover SQL Azure recommended retry period #8275

@kierenj

Description

@kierenj

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:

Connection Timeout Expired. The timeout period elapsed during the post-login phase.
The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections.
This failure occurred while attempting to connect to the routing destination.
The duration spent while attempting to connect to the original server was -
[Pre-Login] initialization=24; handshake=47;
[Login] initialization=0; authentication=0;
[Post-Login] complete=9;
The duration spent while attempting to connect to this server was -
[Pre-Login] initialization=10; handshake=32;
[Login] initialization=0; authentication=0;
[Post-Login] complete=28997;
The wait operation timed out

(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!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions