Repository navigation
Retry transient work-queue dispatch tag reads - #74934
Conversation
Co-authored-by: pelikhan <[email protected]>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the metadata-read retry change.
No open issues 🎉
What changed in this PR
This PR addresses #74601 by applying bounded metadata-read retries to worker snapshot tag verification, preventing transient read failures from prematurely aborting work-queue dispatch.
Changes:
- Route both tag lookup and post-creation read-back through
readNativeMetadatafor retries and fresh 15-second deadlines. - Preserve exact tag verification and single-attempt tag creation and workflow dispatch.
- Add regression coverage for transient recovery, retry exhaustion, and response-body timeouts.
| File | Description |
|---|---|
actions/setup/js/work_queue_native.test.cjs |
Remove retryable 502 errors from no-retry expectations. |
actions/setup/js/work_queue_native.cjs |
Use the metadata retry helper for both dispatch tag reads. |
actions/setup/js/work_queue_native_transport.test.cjs |
Add transport-level tests for recovery, retry limits, deadlines, and write call counts. |
Review effort: Balanced (auto)
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Review completed with one performance concern.
Highlights
- Tag reads now retry appropriately, but the create path can consume roughly 90 seconds because both sequential reads receive independent retry budgets without a combined deadline.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| const sha = immutableRef(destination.ref); | ||
| const ref = `refs/tags/gh-aw/work-queue/${sha}`; | ||
| const parameters = { owner, repo, ref: ref.slice("refs/".length), headers: { "X-GitHub-Api-Version": API_VERSION }, request: { retries: 0, retryCount: 0, timeout: 15000 } }; | ||
| const readTag = () => readNativeMetadata(request => githubClient.rest.git.getRef({ ...parameters, request }), "dispatch.tag.read"); |
There was a problem hiding this comment.
A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag.
💡 Bound the combined tag-preparation latency
The create path performs an initial read and then a read-back, and each independently gets the full retry budget. Under repeated timeouts or 5xx responses this can significantly delay queue dispatch and consume the caller's execution window. Share a deadline/retry budget across both reads (or otherwise cap dispatchTag's total duration), and add coverage for the create path's total budget.
There was a problem hiding this comment.
Fixed in 41f6697: the lookup and read-back now share a three-attempt budget. The create-path regression test verifies the combined read cap and fresh 15-second request deadlines.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs (error-path instrumentation) and /tdd (regression coverage). The retry logic and safety invariants look correct. One observability regression is worth fixing before merge.
📋 Key Themes & Highlights
Key Themes
- Noisy error on the happy path: the expected first-read 404 on a new-tag launch now emits an always-on
dispatch.tag.read.failedline. - Retry behaviour (3 attempts, fresh 15s signal per attempt, no retry on 404/403/429) matches the new tests.
Positive Highlights
- ✅ Exact ref/type/SHA verification and single-attempt create and dispatch are preserved.
- ✅ Tag-read tests cover socket recovery, exhaustion, and swallowed body timeouts with distinct abort signals.
Verification Gap
Vitest could not run in this environment because the npm registry failed TLS verification. I checked the logging behaviour with a direct Node probe instead of the test suite.
@copilot please address the review comment above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~6 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
| const sha = immutableRef(destination.ref); | ||
| const ref = `refs/tags/gh-aw/work-queue/${sha}`; | ||
| const parameters = { owner, repo, ref: ref.slice("refs/".length), headers: { "X-GitHub-Api-Version": API_VERSION }, request: { retries: 0, retryCount: 0, timeout: 15000 } }; | ||
| const readTag = () => readNativeMetadata(request => githubClient.rest.git.getRef({ ...parameters, request }), "dispatch.tag.read"); |
There was a problem hiding this comment.
[/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure.
💡 Suggested fix
Only emit the failure-level log when the read will be retried or has exhausted its budget. A non-transient 404 should go to log.debug, or readNativeMetadata should accept an option that marks 404 as expected for this call site. Either way, add an assertion on log output for the missing-tag create path so this regression is caught.
@copilot please address this.
There was a problem hiding this comment.
Fixed in 41f6697: the first-read 404 is logged at debug level as expected absence, and the create-path test asserts no dispatch.tag.read.failed line is emitted.
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: e5e7cf6
|
|
@copilot run pr-finisher skill |
…gression-fix Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
|
🎉 This pull request is included in a new release. Release: |
Transient failures during worker snapshot tag verification abort dispatch with
work_queue_dispatch_tag_preparation_failed, leaving queued work unprocessed. Unlike other native metadata reads, these reads bypassed bounded retries and fetch-compatible deadlines.readNativeMetadata, allowing up to three attempts with fresh 15-second AbortSignal deadlines and sanitized retry diagnostics.work_queue_dispatch_tag_preparation_failed) #74601