Repository navigation
feat(client): add exponential backoff for status checks - #1212
Merged
badayvedat merged 5 commits intoOct 21, 2026
Merged
Conversation
badayvedat
force-pushed
the
vedat/plat-5625-add-exp-poll-backoff-for-status-checks
branch
from
October 16, 2026 17:13
c8e7df5 to
9d376e0
Compare
bberkay-sahin
approved these changes
Oct 21, 2026
Contributor
|
LGTM, ty @badayvedat |
Contributor
|
one suggestion only might be about the numbers, but we can arrange it if there will be any complaint |
badayvedat
deleted the
vedat/plat-5625-add-exp-poll-backoff-for-status-checks
branch
October 21, 2026 20:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before, the client polled the queue status endpoint at a fixed interval. After, the client uses exponential backoff: the first delay is 250 ms, each base delay grows by 1.05x, capped at 10 s, with +/-20% jitter per delay (also capped at 10 s). A fixed interval can still be requested explicitly.
When the observed request status changes (for example,
IN_QUEUE → IN_PROGRESS), backoff resets to 250 ms by default so a long queue wait does not slow completion detection once running. Queue-position and log updates do not reset it.COMPLETEDstops polling without another sleep. Explicit fixed intervals remain unchanged.Chart and table assume no status transitions. Backoff resets to its initial delay on an observed status change; polling stops on
COMPLETED.Numbers below use the base curve without jitter and assume zero request latency. Request latency reduces polling counts; jitter can change them in either direction.
Note
Medium Risk
Default polling behavior changes for all callers that relied on implicit fixed-interval waits, which affects queue load and how quickly completion is detected unless
intervalis set explicitly.Overview
Queue status polling no longer defaults to a fixed 100 ms interval. It now uses configurable exponential backoff via a new public
PollBackofftype (defaults: 250 ms start, 1.05× growth, 10 s cap, ±20% jitter), exported from the package.iter_events,get, and sync/asyncsubscribeaccept optionalbackoffand treatintervalas optional (None→ backoff). An explicitintervalstill forces fixed spacing and overrides backoff. When using backoff, the delay sequence resets on a change in status kind (e.g.Queued→InProgress), not on queue-position or log-only updates; completion returns without an extra sleep.DEFAULT_QUEUE_POLL_INTERVALremains for import compatibility but is documented as deprecated for polling behavior. Unit tests coverPollBackoffvalidation and sync/async polling sleep patterns.Reviewed by Cursor Bugbot for commit 9d376e0. Bugbot is set up for automated code reviews on this repo. Configure here.