Repository navigation
fix(taskpool): retry OpenQueue through queue-creation consistency window (#70) - #464
Merged
Merged
Conversation
…tency window (#70) A pool worker resolves its queue at boot; GetQueueUrl is eventually consistent after CreateQueue, so a fast worker raced it, got NonExistentQueue, and exited (workers run once at boot) — the pool never drained. Found in a real-AWS re-smoke. OpenQueue now retries NonExistentQueue (bounded); other errors fail fast.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jul 31, 2026
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.
Found in a real-AWS re-smoke of the pool (after v0.96.1's spored-bootstrap fix let workers boot far enough to expose it).
Symptom
Workers booted, installed spored fine (v0.96.1 retry fix worked — "✅ Checksum verified"), but the queue stayed at "4 waiting" and no task ran. SSM into a worker showed cloud-init failed with:
…seconds after boot — even though the queue did exist (the submitter created it and
pool statussaw it).Root cause
taskpool.OpenQueuedid a singleGetQueueUrl. That call is eventually consistent after the submitter'sCreateQueue, so a fast-booting worker races the create and getsNonExistentQueue. The worker runsspored pool-workeronce at boot, so an error there = it exits and never pulls.Fix
OpenQueuenow retriesNonExistentQueuethrough the consistency window (10 × ~3s, bounded; matched viasmithyAPI error code, not message text). Any other error (auth/throttle/malformed) still fails fast. A queue that never appears within the budget returns an error (fails loud, not silent).Tests:
TestOpenQueue_RetriesNonExistentQueue(3 misses then resolves) andTestOpenQueue_GivesUpAfterBudget; retry delay is a test-shrinkable var.pkg/taskpoolgreen under-race.Known follow-up (not in this PR)
There's a deeper robustness point:
spored pool-workerruns as a one-shot cloud-init invocation, so ANY early exit (not just this one) means the worker never restarts. This PR fixes the actual failure mode observed (the consistency race); making the worker a restart-on-exit service is a separate hardening I'll file as an issue rather than expand scope here.Refs #70.