Repository navigation
fix(execution): local task start no longer hangs when an unrelated process exits - #501
Merged
Merged
Conversation
Owner
Author
Codex review (GPT 6.1 Sol)No material findings in PR #501: no blockers, should-fix items, or nits.
One existing limitation remains at |
allisonmahmood
added a commit
that referenced
this pull request
Oct 3, 2026
Gap: the surviving-group recovery case hit the procfs ESRCH race that open PR #501 fixes, so it cannot land before it; this removes it and keeps the stale-identity case. That case now registers its own cleanup before killing anything: recorded processes and the supervisor's group are SIGKILLed only while their recorded start time still matches, without relying on the recovery under test. Its procfs observations retry, since a read can race a process's exit until #501 lands. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 54582c8ceb0088a05f70df6c28a0039584d5a8b6)
allisonmahmood
added a commit
that referenced
this pull request
Oct 3, 2026
Gap: the surviving-group recovery case hit the procfs ESRCH race that open PR #501 fixes, so it cannot land before it; this removes it and keeps the stale-identity case. That case now registers its own cleanup before killing anything: recorded processes and the supervisor's group are SIGKILLed only while their recorded start time still matches, without relying on the recovery under test. Its procfs observations retry, since a read can race a process's exit until #501 lands. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 54582c8ceb0088a05f70df6c28a0039584d5a8b6)
allisonmahmood
added a commit
that referenced
this pull request
Oct 3, 2026
The test audit found behaviour that matters and that no test checked at any layer. This adds those tests. One of them found a real bug, fixed here. **Security and isolation** - `POST /api/runtime/subscriptions` refuses bearer tokens, cross-site requests, a wrong wire, a principal mismatch, and another viewer's, another company's, a stale or a wrong-version document. A second viewer cannot take over a document by reusing its id. Removing each ownership guard makes its test fail. - SDK generation refuses another company's shared table, shared store and target patch. - Logout revokes the signed-in Clerk session, not just its cookies. The portal's `/log` route joins the signed-out and foreign-company 404 checks. - The ECS task provider refuses unsafe options and a partial previous revision, which would otherwise silently lose rollout auth during secret rotation. - The CLI writes `credentials.json` and the pending device login owner-only from the first byte (0600 file, 0700 directory), as ADR-0004 promises. **Data loss and reclamation** - Purging a tier 2 patch reclaims every server artifact, including after a failed object delete. - When file reclamation stops part way, the orphan sweep finishes it without touching another patch's files. - Recovery reclaims a local task record whose pid now belongs to an unrelated live process, without signalling that process. The case where the detached owner itself dies is parked on `test/local-owner-recovery-parked` until #501 lands: on CI it hit the `ESRCH` race #501 fixes. - The Postgres connector's cancel is admitted (a private DNS answer is refused before any socket) and verified over TLS. Its backend really stops. **Rules now pinned** - **Quota:** two different creates racing for an owner's last slot get one 201 and one `live_patch_quota_exceeded`. The quota gates creation only (decided): restore and reassign may leave an owner above it, and the glossary now says so. - **CLI:** SIGTERM exits 130 like SIGINT. The tier 0 starter builds and publishes under the static-page policy. - **Patch list:** it leaves out another company's patches. - **Typed refusal codes:** `Refusal.code` is now the API's refusal-code union, so a mistyped code in the definitive-refusal list fails typecheck instead of silently keeping or discarding a saved publish. **Bug fixed:** `S3ContentStore.list` only refused a continuation token equal to the one it had just sent. A listing whose tokens cycled kept paging until the server failed. It now refuses any token already seen in the listing. Malformed listings (missing key or timestamp, invalid date, truncated without a token) now fail within one or two requests. Made by Claude Opus 5.5 via Claude Code --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…l task start A process reaped after procfs opens its stat file fails the read with ESRCH, not ENOENT. The local task store treated that as an error, so the owner of a task that missed readiness died before recording `stopped` and `start` waited out its ~10s deadline. The store's process readers and the owner's kill sites now treat ESRCH as "already gone". Closes #486 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Narrows the mocked path instead of casting it, and the owner's kill helper says a negative pid signals a group. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
allisonmahmood
force-pushed
the
t3code/implement-issue-486
branch
from
October 3, 2026 18:42
da0a97a to
d408ea0
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.
When a local task missed readiness, its owner killed it and then scanned
/procto make sure nothing was left. If any process on the machine exited between the scan opening its/proc/<pid>/statand reading it, the read failed withESRCH. The store only treatedENOENTas "gone", so the owner crashed before recordingstopped, andstartwaited out its ~10s deadline. That is the CI flake in #486.The store's process readers (
processIdentity,groupMembers) now treatESRCHlikeENOENT, the same way the execution launcher's/procreader and the CLI's dev state already do. The owner's threeSIGKILLsites go through one helper that tolerates a process that exited after it was seen alive. The owner still writesstoppedonly after it has seen the exit itself.Verified:
LocalTaskStore.test.tsopens a process's stat file, reaps the process, then reads through the open handle, so the kernel raises a realESRCH. Both tests failed withESRCHbefore the fix.sleepprocesses churning, the readiness-reap test failed 3 of 40 runs onmain(10.3–10.5s timeouts) and passed 40 of 40 with the fix (389–699ms). Its 10s budget is unchanged.pnpm verifysuite passes locally, run one at a time: format, lint, typecheck,pnpm test(1627 tests),postgres-concurrency,cli-smoke,tier2-smokeandbrowser.Closes #486
Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.