Skip to content

馃悰 Enforcing the waitForGeneration timeout on in-flight polls and retries - #18

Merged
simonc merged 1 commit into
mainfrom
wait-for-generation-deadline
Oct 5, 2026
Merged

simonc merged 1 commit into
mainfrom
wait-for-generation-deadline

Conversation

@simonc

@simonc simonc commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

waitForGeneration documents timeout as a total budget, but it was only checked between polls. A slow get() (and its internal retries) could run past it: a late success resolved, and a late pending response only reported the timeout once it came back.

Changes

  • The budget is now a deadline AbortController, composed with the caller's signal and passed to every poll and to the sleep between polls. When it fires, the in-flight request is aborted and the call rejects with the usual "timed out" error.
  • Caller cancellation still surfaces as an abort, not a timeout; a pre-aborted signal still rejects without polling.
  • Regression tests with a slow, abort-aware fetch (late success, late pending, caller abort, pre-aborted signal). The first two fail without the fix.
  • Patch changeset.

@simonc
simonc merged commit ad9d7cd into main Oct 5, 2026
6 checks passed
@simonc
simonc deleted the wait-for-generation-deadline branch October 5, 2026 21:32
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.

1 participant