Skip to content

Commit

Permalink
[Internal] Documentation: Adds 429 mention on SDK design doc (#3476)
Browse files Browse the repository at this point in the history
  • Loading branch information
ealsur committed Sep 28, 2022
1 parent 2a34beb commit 9f46192
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/SdkDesign.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ flowchart
UserHandlers <--> DiagnosticHandler
DiagnosticHandler <--> TelemetryHandler
TelemetryHandler <--> RetryHandler[Cross region retries]
RetryHandler <--> RouteHandler
RetryHandler <--> ThrottlingRetries[Throttling retries]
ThrottlingRetries <--> RouteHandler
RouteHandler <--> IsPartitionedFeedOperation{{Partitioned Feed operation?}}
IsPartitionedFeedOperation <-- No --> TransportHandler
IsPartitionedFeedOperation <-- Yes --> InvalidPartitionExceptionRetryHandler
Expand All @@ -38,6 +39,12 @@ flowchart
TransportHandler <--> TransportClient[[Selected Transport]]
```

## Throttling retries

Any HTTP response, with a status code `429` from the service means the current operation is being [rate limited](https://learn.microsoft.com/azure/cosmos-db/sql/troubleshoot-request-rate-too-large) and it's handled by the [RetryHandler](../Microsoft.Azure.Cosmos/src/Handler/RetryHandler.cs) through the [ResourceThrottleRetryPolicy](../Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs).

The policy will retry the operation using the delay indicated in the `x-ms-retryafter` response header up to the maximum configured in `CosmosClientOptions.MaxRetryAttemptsOnRateLimitedRequests` with a default value of 9.

## Cross region retries

Any failure response from the Transport that matches the [conditions for cross-regional communication](https://docs.microsoft.com/azure/cosmos-db/troubleshoot-sdk-availability) are handled by the [RetryHandler](../Microsoft.Azure.Cosmos/src/Handler/RetryHandler.cs) through the [ClientRetryPolicy](../Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs).
Expand Down

0 comments on commit 9f46192

Please sign in to comment.