dotnet
data_error
ai_generated
partial
Microsoft.EntityFrameworkCore.Storage.RetryLimitExceededException: The execution strategy 'SqlServerRetryingExecutionStrategy' executed the operation 6 time(s) without success.
ID: dotnet/ef-core-connection-resiliency-failed-to-retry
85%Fix Rate
82%Confidence
1Evidence
2023-03-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Entity Framework Core 6.0.x | active | — | — | — |
| Entity Framework Core 7.0.x | active | — | — | — |
| Entity Framework Core 8.0.x | active | — | — | — |
Root Cause
Entity Framework Core's retry execution strategy exhausted its retry attempts due to persistent transient faults like deadlocks, timeouts, or network blips from SQL Server.
generic中文
Entity Framework Core 的重试执行策略因 SQL Server 的持久性瞬时故障(如死锁、超时或网络波动)而耗尽重试次数。
Official Documentation
https://learn.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliencyWorkarounds
-
75% success Analyze SQL Server error logs for deadlocks or timeouts; optimize queries or indexes to reduce contention.
Analyze SQL Server error logs for deadlocks or timeouts; optimize queries or indexes to reduce contention.
-
85% success Reduce retry interval and increase max retry count with exponential backoff in DbContext options.
Reduce retry interval and increase max retry count with exponential backoff in DbContext options.
-
70% success Implement custom execution strategy to log and handle specific transient exceptions like deadlock (1205).
Implement custom execution strategy to log and handle specific transient exceptions like deadlock (1205).
中文步骤
Analyze SQL Server error logs for deadlocks or timeouts; optimize queries or indexes to reduce contention.
Reduce retry interval and increase max retry count with exponential backoff in DbContext options.
Implement custom execution strategy to log and handle specific transient exceptions like deadlock (1205).
Dead Ends
Common approaches that don't work:
-
90% fail
Increasing retry count without addressing root cause just delays failure.
-
95% fail
Disabling retry entirely makes app brittle to transient faults.
-
80% fail
Switching to a different execution strategy doesn't fix underlying database issues.