Repository navigation
fix(server): make same-pod attempt start idempotent (#1001) - #1026
Merged
Merged
Conversation
4 tasks
athvin
marked this pull request as ready for review
November 9, 2026 06:09
athvin
force-pushed
the
issue/1001-idempotent-start
branch
from
November 9, 2026 06:24
cba2d9e to
05c73e5
Compare
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.
Closes #1001
What
Make the declared attempt-start transition return the existing running row when the same pod retries. Preserve its original identity and timestamps; keep the live attempt and Kubernetes Job fences.
Why
A lost 200 after a committed start currently becomes a terminal 409 on retry, so the executor can report
stale_startfor a pod that started successfully.Proof
make checkpassed locally oncba2d9e5and again after rebasing on currentmainat05c73e51(full backend gate).pg_task_instancestest passed against isolated PostgreSQL 16;er-entity verifyfound 145 generated files current and every statement passing E0xx.sccacherelease-download HTTP 504 failures; rebasing and rerunning cleared them.Risk & rollback
Risk: the start statement also handles running rows from the same pod; the Postgres regression checks the boundary and the 409 fences.
Rollback: revert the eventual squash merge commit.
Post-merge ledger
Closed by: Codex · session
Codex:01a1be03-fa4f-7c42-82b6-91e1838f928fonMac-26· 2026-11-09T07:22:40Zmainis green with this change on it — squashcd4ddd50a9b8cc6b596d43b38e1bfc65ee24b886is onorigin/main; its rust run 42574267648, frontend 42574267646, infra 42574267691, and devcontainer 42574267535 all passed. The 30-minute watch ended at 2026-11-09T07:08:16Z without a new failure. Currentmainatef9ab24fdescends from this squash; its frontend, infra, and devcontainer runs passed, and its Rust run was queued at closure.imagesbuilt, or correctly never ran because nothing that goes intoan image changed: run 42574267609 built and pushed
er-apiforcd4ddd50; unchangeder-webwas skipped.deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: run 42574724930 logged
deploying cd4ddd50and succeeded for prod and dev. Both liveer-apiServices select blue; both readyweb-api-bluedeployments run the new API digestbc7d7b5b…. Their runninger-serverprocesses emitteder-server listeningat 2026-11-09T06:43:29.659483Z (prod) and 06:44:11.360985Z (dev).deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy 42574724930 is green. The last scheduled drift run 42570659369 failed before this merge on missing Cloudflare auth (Restore Cloudflare authentication in the scheduled Terraform drift workflow #1030) and a GitHub 504;
cluster-objectscorrectly did not trigger for this Rust-only diff. kind nightly 42575735163 passed on the merge SHA, as did scheduled frontend 42576920853 and Agentic Maintenance 42577146694. Scheduled Rust 42577173686 was still running without a failed job at closure; the required Rust run on the merge SHA had already passed.Donethrough the automation rather than byhand, and the issue closed: rust: make same-pod attempt start retry idempotent #1001 is
CLOSED, its closure event names PR fix(server): make same-pod attempt start idempotent (#1001) #1026, and its Product Roadmap card readsDonewithout a manual board edit.(a skill, a reference, memory) — or nothing new was learned:
entities/task_instance/update/start.yamldescribes the retry contract, andpg_task_instances.rspins the lost-response and fence cases in a Postgres regression.Specific to this change
Context — plan, discoveries, measurements, files
Plan
entities/task_instance/update/start.sqlso the queued transition or a running retry from the samepod_uidreturns one row under the existing attempt, live, and Kubernetes Job guards. Keep the original identity,started_at, heartbeat, and update timestamps on a replay; update the statement description.pg_task_instancesPostgres scenario: treat the first 200 as lost, retry from the same pod, compare timestamps and stored identity, and verify a different pod, wrong Job, and archived attempt still receive 409.er-entity verify, the Postgres test tier, and rootmake check; record any environment limitation explicitly.Discoveries
Measurements
er-entity verify: 145 generated files current; every statement passed E0xx.ER_TEST_PG_DSN=… cargo test -p er-server --test main pg_task_instances::the_task_ledger_statements_hold_their_contracts -- --nocapture: 1 passed against isolated Postgres 16.make check: passed oncba2d9e5and rebased05c73e51. Run 42570514147 failed onsccacherelease-download HTTP 504; run 42572887686 passed all Rust jobs on the rebased head.Files