Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Azure DevOps throttling/rate limiting #309

Open
johnbatty opened this issue Dec 21, 2023 · 1 comment
Open

Add support for Azure DevOps throttling/rate limiting #309

johnbatty opened this issue Dec 21, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@johnbatty
Copy link
Contributor

johnbatty commented Dec 21, 2023

Azure DevOps services provide throttling feedback via response headers:

We have definitions for these headers in the SDK, but currently don't inspect or process them. It would be good to add common function to clients to provide throttling to avoid hitting limits. This should probably be implemented as an azure_core pipeline policy.

It is worth mentioning I recently enhanced the underlying azure_core pipeline to handle retry-after headers when receiving TooManyRequests or ServiceUnavailable responses, and a future release of azure_devops_rust_api will pick this up when it is released. So that will give appropriate backoff/throttling upon hitting the TooManyRequests state. Implementing support for these additional feedback headers would help reduce the chances of hitting the TooManyRequests limit.

Note: I can see that these headers provide feedback, but it is unclear to me what the actual implementation of the processing logic should be. This needs further investigation - including checking whether any of the other SDKs implement this.

Relevant links:

@johnbatty johnbatty added the enhancement New feature or request label Dec 21, 2023
@johnbatty
Copy link
Contributor Author

Regarding implementation, I found this example which calculates the resource units left in the current window and if this is below a threshold (10% by default), then delays until the window is reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant