Azure / azure-sdk-for-rust

This repository is for active development of the *unofficial* Azure SDK for Rust. This repository is *not* supported by the Azure SDK team.
MIT License
692 stars 237 forks source link

Add throttling support using retry-after headers #1517

Closed johnbatty closed 8 months ago

johnbatty commented 8 months ago

Fixes: https://github.com/Azure/azure-sdk-for-rust/issues/1516

Updated azure_core retry policy to implement throttling by looking for and using the values returned by a server via retry-after, retry-after-ms or x-ms-retry-after-ms headers when the server returns 429 (TooManyRequests) or 503 (ServerUnavailable).

Details:

johnbatty commented 8 months ago

@reillysiemens This may be of interest, given your comments in https://github.com/Azure/azure-sdk-for-rust/pull/1510

This obviously doesn't do anything to support the additional Azure DevOps throttling headers that you wanted to add (which are more about monitoring/controlling request rate to avoid hitting server throttling), but does at least provide appropriate throttling delays and retries when the server returns TooManyRequests. Once this change is in azure_core, it will get picked up by the next release of azure-devops-rust-api.