Handle the transient errors in efcore when using Cosmos DB #28629
Labels
area-cosmos
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
community-contribution
customer-reported
type-enhancement
Milestone
It is possible to encounter transient errors when using efcore with Cosmos DB, and it seems that the efcore cannot handle such errors (like 410 Gone) now. Is it better if we can provide some retries for the transient error codes? Otherwise APIs like: CreateDatabaseIfNotExistsAsync, CreateContainerStreamAsync, CreateItemStreamAsync, ReadNextAsync, ReadNextAsync, DeleteItemStreamAsync, ReplaceItemStreamAsync, ReadItemStreamAsync will directly fail due to transient faults.
As this document shows, there are some transient error codes (408, 410, 429, 449, and 503) that we can retry to make efcore more resilient:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/conceptual-resilient-sdk-applications#should-my-application-retry-on-errors
The text was updated successfully, but these errors were encountered: