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:
Throttling of client requests is typically handled by a server returning a status of 429 (
TooManyRequests
), with aretry-after
header indicating how long the client should delay before retrying the request. The currentazure_core
request pipeline has various retry policies to handle retries for this status code, but none of them inspect or use theRetry-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:
retry-after-ms
x-ms-retry-after-ms
The Javascript Azure SDK looks for the headers in this order:
retry-after-ms
x-ms-retry-after-ms
retry-after
See here for general Azure retry guidance.