Repository navigation
fix(queue): retry control-plane calls through deploy-length outages - #1955
Conversation
The exact-review Durable Object answers HTTP 500 for 15-30 seconds during a Worker deploy or reset (2026-10-13 03:54, 04:21 and the 04:52 deploy). control_plane_curl gave up after four attempts and about 14 seconds, so completed Codex reviews failed finalization or completion and were discarded. Allow up to six attempts within a 62-second backoff budget, with Retry-After waits drawn from the same budget so the worst case stays bounded.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The Linux-only startup-authority e2e pinned four requests for its service and transport failure scenarios. With the 62-second budget, its transport scenario would also outrun the 45-second scenario timer, so its private helper copy now skips backoff waits; test/control-plane-curl.test.ts keeps owning retry timing.
|
@clawsweeper re-review Current proof and validation for head 37fe7ca are in the PR body. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR extends shared control-plane retries to six attempts with a 62-second total backoff budget and updates documentation and coverage. Example: The control plane returns HTTP 500 for 20 seconds before recovering.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: current main still exhausts retries during the documented outage windows, and this narrow change addresses that failure without an actionable correctness finding. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherWorkflow shell steps send queue, heartbeat, completion, and lifecycle requests through the shared curl helper, which returns the final response to existing lease-aware callers. flowchart LR
A[Workflow step] --> B[Shared curl helper]
B --> C[Control plane]
C --> D[Queue lease checks]
C --> E[Response or transport failure]
E --> B
B --> F[Final response to caller]
Technical reviewBest possible solution: Retain the shared bounded retry owner and adopt the longer backoff budget while preserving existing response and lease-rejection semantics. Do we have a high-confidence way to reproduce the issue? Current-main source exhausts four attempts after 14 seconds of fallback backoff, and the supplied real-HTTP baseline trace demonstrates failure during a 20-second outage; this review executed no target code. Is this the best way to solve the issue? The change addresses insufficient transient-failure tolerance in the existing shared owner, with a finite attempt limit and shared Retry-After budget; diagnosing longer queue overloads remains separate work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dc9730979277. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 13, 2026, 4:06 AM ET / 08:06 UTC. |
Summary
Completed Codex reviews are being thrown away because the workflow's control-plane retry gives up before a short queue outage ends.
On 2026-10-13 the exact-review Durable Object answered HTTP 500 for 15–30 seconds three times within an hour: 03:54:45–03:55:05, 04:21:36–04:22:05, and 04:52:52–04:53:08, the last during a Worker deploy (Cloudflare deployment records at 04:52:54 and 04:53:08).
control_plane_curlretries 5xx only four times with 2/4/8-second waits, so it gives up about 14 seconds in. In those windows:Exact-review lease could not enter finalization, review discarded. The next call succeeded at 03:55:07.14 of the 29 failed exact-review runs in that three-hour window fell into these three bursts: 10 classified
queue_completion_failure, and 4 that finished their review (review_outcome=success, exit 0) but were classifiedcodex_or_content_failurebecause the direct-publication lifecycle post exhausted the same helper. In https://github.com/openclaw/clawsweeper/actions/runs/38347798743 that post's first attempt hung for its 20-second timeout at 04:52:42, attempts 2–4 got 500 until 04:53:17, and the queue still answered 500 at 04:53:32, so the deploy outage lasted about 50 seconds. That is why the new budget is about a minute, not 30 seconds.Change
scripts/control-plane-curl.shnow allows up to six attempts within a 62-second backoff budget (2, 4, 8, 16, 32). ARetry-Afterdelay (still capped at 60 seconds) replaces the next wait and draws from the same budget, and the next failure after the budget is spent is final, so the worst case stays bounded even when the queue keeps answering 503 withRetry-After. 4xx stays terminal; curl's exit code, stdout, output file and body handling are unchanged. Every caller already retried these lease-fenced requests three times, so idempotency is unchanged.Heartbeats keep their behavior: a failed heartbeat is still non-fatal and the loop still sleeps 60 seconds, but a retry now lands about 30 seconds into an outage instead of the next 74-second cycle. The 20-minute
EXACT_REVIEW_HEARTBEAT_GRACE_MSleaves ample room.docs/scheduler.mddocuments the new contract;changelog.d/control-plane-outage-retries.mdrecords it.Behavior proof
control_plane_curlhelper with realcurland realsleep, against a local HTTP server that answers 500 until a deadline and 200 afterwards.node run-proof.mjs <helper.sh> <outage-seconds> <label>, run againstmain(7a6def5328) and this branch. macOS, bash 5.3, curl 8.Validation
test/control-plane-curl.test.ts: 14/14 on macOS (bash 5.3) and innode:24-bookworm(bash 5.2, curl 7.88). New scenarios cover a deploy-length outage that recovers on the fifth attempt andRetry-Afterdraining the shared budget. Againstmain's helper the deploy-length scenario fails.update-command-status,exact-review-queue-client,exact-review-reconcile-workflow,workflow-sparse-checkout,sweep-workflow: 190/190 afterbuild:all.scripts/e2e/exact-review-start-authority.mjspinned four requests for its service and transport failure scenarios, and its transport scenario would now outrun the 45-second scenario timer under real backoff. It expects six attempts, and its private helper copy skips backoff waits (guarded by an assertion), sotest/control-plane-curl.test.tskeeps owning retry timing. Innode:24-bookwormall Linux-only tests pass (exact-review-start-authorityin 8.9 s,hosted-review-canary-proof,command-runner,apply-drift-refresh): 119 passed, 6 skipped by design.pnpm run check:staticandgit diff --checkpass./review(autoreview, P0–P2): clean on the uncommitted change and on the committed branch against its merge-base.OpenClaw Bay
Not affected. No status, lifecycle, telemetry or projection contract changes; only the workflow-side retry timing of control-plane requests.