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

Server `retry-after` throttling headers are ignored #1516

Closed johnbatty closed 8 months ago

johnbatty commented 8 months ago

Throttling of client requests is typically handled by a server returning a status of 429 (TooManyRequests), with a retry-after header indicating how long the client should delay before retrying the request. The current azure_core request pipeline has various retry policies to handle retries for this status code, but none of them inspect or use the Retry-After header value.

It is worth noting that there are some services that provide alternative retry-after headers that specify the retry time with millisecond precision. Any fix should also handle these headers if present:

The Javascript Azure SDK looks for the headers in this order:

See here for general Azure retry guidance.