app-server: claim thread teardown groups atomically#31400
app-server: claim thread teardown groups atomically#31400winston-openai wants to merge 2 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Summary
Generalize the tracked teardown coordinator from one
ThreadIdto an exact operation-owned group. Initial claims deduplicate and preflight the complete ID set under one registry lock, while group extensions immediately own free IDs and register an exact weak successor for every contested ID.A coordinator-wide affine freeze guard serializes tree-discovery and extension phases even when callers must drop the app-server thread-list permit to await an older teardown. When that predecessor releases, the registry transfers each contested
ThreadIddirectly to the live successor before signaling completion. This removes both cross-extension deadlocks and the scheduler-sized admission gap where a descendant could otherwise be resumed or attached.Operation identity, exact
Arcrelease checks, and cancellation-aware weak handoffs keep stale owners from removing or resurrecting successor claims. Existing single-ID idle unload and cleanup continue through compatibility wrappers backed by the same coordinator.Stacked on #31399. The next layer uses this primitive for complete-tree teardown and retains the same claim through archive/delete mutation or same-
ThreadIdsuccessor publication.Validation
just fix -p codex-app-serverjust fmt