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

Introduce retry with backoff #42

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

jmuziki
Copy link
Contributor

@jmuziki jmuziki commented Jan 18, 2025

This pull request includes several changes to the invoke method in the src/fabric_cicd/_common/_fabric_endpoint.py file, focusing on improving error handling and retry logic for API requests. The most important changes include the addition of a new _handle_retry method, enhanced error messaging, and improved handling of API throttling and long-running operations.

Improvements to error handling and retry logic:

  • Added a new _handle_retry method to handle retry logic with exponential backoff based on the response headers. This method is called when the Retry-After header is present in the response.
  • Enhanced error messaging for failed operations and deployment attempts, improving readability and clarity. [1] [2]

Handling of API throttling and long-running operations:

  • Improved handling of API throttling by using the _handle_retry method when the Retry-After header is present in the response. This change ensures that the retry logic is consistent and robust.
  • Added logic to handle retries for long-running operations when the Retry-After header is present in the response. This change ensures that the system waits appropriately before retrying the operation.

Minor improvements:

  • Fixed a typo in a log message to improve clarity.

@jmuziki jmuziki linked an issue Jan 23, 2025 that may be closed by this pull request
@jmuziki jmuziki force-pushed the feature/RetryWithBackoff branch from 684cd49 to 08bab2d Compare January 24, 2025 17:32
@jmuziki jmuziki marked this pull request as ready for review January 24, 2025 18:02
@jmuziki jmuziki requested a review from a team as a code owner January 24, 2025 18:02
@jmuziki jmuziki enabled auto-merge (squash) January 24, 2025 18:04
@jmuziki jmuziki merged commit 65a3bc6 into microsoft:main Jan 24, 2025
5 checks passed
@jmuziki jmuziki deleted the feature/RetryWithBackoff branch January 24, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retry with Backoff
3 participants