You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/sql/conceptual-resilient-sdk-applications.md
+24-17Lines changed: 24 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Designing resilient applications with Azure Cosmos DB SDKs
3
3
description: Learn how to build resilient applications using the Azure Cosmos DB SDKs and what all are the expected error status codes to retry on.
4
4
author: ealsur
5
5
ms.service: cosmos-db
6
-
ms.date: 03/25/2022
6
+
ms.date: 05/05/2022
7
7
ms.author: maquaran
8
8
ms.subservice: cosmosdb-sql
9
9
ms.topic: conceptual
@@ -50,23 +50,23 @@ Your application should be resilient to a [certain degree](#when-to-contact-cust
50
50
51
51
The short answer is **yes**. But not all errors make sense to retry on, some of the error or status codes aren't transient. The table below describes them in detail:
52
52
53
-
| Status Code | Should add retry | Description |
53
+
| Status Code | Should add retry |SDKs retry |Description |
54
54
|----------|-------------|-------------|
55
-
| 400 | No |[Bad request](troubleshoot-bad-request.md)|
56
-
| 401 | No |[Not authorized](troubleshoot-unauthorized.md)|
| 409 | No | Conflict failure is when the identity (ID and partition key) provided for a resource on a write operation has been taken by an existing resource or when a [unique key constraint](../unique-keys.md) has been violated. |
| 412 | No | Precondition failure is where the operation specified an eTag that is different from the version available at the server. It's an [optimistic concurrency](database-transactions-optimistic-concurrency.md#optimistic-concurrency-control) error. Retry the request after reading the latest version of the resource and updating the eTag on the request.
63
-
| 413 | No |[Request Entity Too Large](../concepts-limits.md#per-item-limits)|
64
-
| 429 | Yes | It's safe to retry on a 429. Review the [guide to troubleshoot HTTP 429](troubleshoot-request-rate-too-large.md).|
65
-
| 449 | Yes | Transient error that only occurs on write operations, and is safe to retry. This can point to a design issue where too many concurrent operations are trying to update the same object in Cosmos DB. |
66
-
| 500 | No | The operation failed due to an unexpected service error. Contact support by filing an [Azure support issue](https://aka.ms/azure-support). |
| 409 | No |No |Conflict failure is when the identity (ID and partition key) provided for a resource on a write operation has been taken by an existing resource or when a [unique key constraint](../unique-keys.md) has been violated. |
| 412 | No | No | Precondition failure is where the operation specified an eTag that is different from the version available at the server. It's an [optimistic concurrency](database-transactions-optimistic-concurrency.md#optimistic-concurrency-control) error. Retry the request after reading the latest version of the resource and updating the eTag on the request.
63
+
| 413 | No |No |[Request Entity Too Large](../concepts-limits.md#per-item-limits)|
64
+
| 429 | Yes |Yes |It's safe to retry on a 429. Review the [guide to troubleshoot HTTP 429](troubleshoot-request-rate-too-large.md).|
65
+
| 449 | Yes |Yes |Transient error that only occurs on write operations, and is safe to retry. This can point to a design issue where too many concurrent operations are trying to update the same object in Cosmos DB. |
66
+
| 500 | No |No |The operation failed due to an unexpected service error. Contact support by filing an [Azure support issue](https://aka.ms/azure-support). |
In the table above, all the status codes marked with **Yes**on the second column should have some degree of retry coverage in your application.
70
70
71
71
### HTTP 403
72
72
@@ -97,6 +97,13 @@ Because of the nature of timeouts and connectivity failures, these might not app
97
97
98
98
It's recommended for applications to have their own retry policy for these scenarios and take into consideration how to resolve write timeouts. For example, retrying on a Create timeout can yield an HTTP 409 (Conflict) if the previous request did reach the service, but it would succeed if it didn't.
99
99
100
+
### Language specific implementation details
101
+
102
+
For further implementation details regarding a language see:
From the client perspective, any retries will affect the end to end latency of an operation. When your application P99 latency is being affected, understanding the retries that are happening and how to address them is important.
0 commit comments