Skip to content

Retry transient API errors with exponential backoff#129

Merged
adamlogic merged 1 commit intomainfrom
adam/jdo-1282-add-api-retries-for-python-adapter
Feb 26, 2026
Merged

Retry transient API errors with exponential backoff#129
adamlogic merged 1 commit intomainfrom
adam/jdo-1282-add-api-retries-for-python-adapter

Conversation

@adamlogic
Copy link
Member

@adamlogic adamlogic commented Feb 26, 2026

Transient network conditions can result in timeouts that can often be retried successfully.


Note

Medium Risk
Adds retry/backoff behavior around metrics posting; low complexity but changes runtime network behavior and could affect reporting latency under failure conditions.

Overview
Reporter now retries transient network failures when posting metrics. Reporter._report_metrics retries up to MAX_RETRIES (3) on ConnectionError/Timeout with exponential backoff, and logs a dedicated warning if it still cannot connect.

Non-transient requests errors (e.g., HTTP failures) still log once and abort without retry. Tests were added to assert retry vs non-retry behavior while patching requests.post/time.sleep.

Written by Cursor Bugbot for commit ab3f002. This will update automatically on new commits. Configure here.

Transient network conditions can result in timeouts that can often be retried successfully.
Copy link
Member

@carlosantoniodasilva carlosantoniodasilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice.

@adamlogic adamlogic merged commit 80a1b05 into main Feb 26, 2026
6 checks passed
@adamlogic adamlogic deleted the adam/jdo-1282-add-api-retries-for-python-adapter branch February 26, 2026 16:49
carlosantoniodasilva added a commit to judoscale/judoscale-node that referenced this pull request Mar 5, 2026
Retry up to 3 times for transient errors, matching the behavior of
Python and Ruby.

judoscale/judoscale-python#129
judoscale/judoscale-ruby#265
carlosantoniodasilva added a commit to judoscale/judoscale-node that referenced this pull request Mar 5, 2026
Retry up to 3 times for transient errors, matching the behavior of
Python and Ruby.

judoscale/judoscale-python#129
judoscale/judoscale-ruby#265
carlosantoniodasilva added a commit to judoscale/judoscale-node that referenced this pull request Mar 5, 2026
Retry up to 3 times for transient errors, matching the behavior of
Python and Ruby.

judoscale/judoscale-python#129
judoscale/judoscale-ruby#265
carlosantoniodasilva added a commit to judoscale/judoscale-java that referenced this pull request Mar 5, 2026
…sts (#12)

Similar logic for retry backoff from the Ruby/Python/Node packages.

Also update the timeout seconds to 5 to match across the board.

judoscale/judoscale-node#97
judoscale/judoscale-python#129
judoscale/judoscale-ruby#265
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.

2 participants