Skip to content

app-server: serialize teardown admission by thread id#31399

Closed
winston-openai wants to merge 1 commit into
dev/winston/app-server-idle-teardown-ownerfrom
dev/winston/app-server-exact-teardown-admission
Closed

app-server: serialize teardown admission by thread id#31399
winston-openai wants to merge 1 commit into
dev/winston/app-server-idle-teardown-ownerfrom
dev/winston/app-server-exact-teardown-admission

Conversation

@winston-openai

Copy link
Copy Markdown
Contributor

Summary

Serialize listener and teardown admission by the stable logical ThreadId. Listener attachment and thread/resume now acquire the global thread-list permit, subscribe to any existing exact teardown owner, drop the permit before waiting, and retry internally after completion instead of returning a normal "closing; retry" error.

Running resume still reserves its connection before releasing admission. Unsubscribe and stale-connection cleanup register exact tracked claims before dropping the permit, so cancellation of a waiter cannot abandon cleanup. Realtime admission returns the exact Arc<CodexThread> fetched and subscribed after any wait, preventing downstream operations from using a stale pre-wait generation.

Archive and delete remain unchanged here because they operate on complete thread trees; their ownership moves with the atomic multi-ID subtree claim in the next stacked layer.

Stacked on #31395.

Validation

  • Focused teardown and lifecycle suites cover singleflight ownership and resume reservations.
  • Running and path-based resume tests pass through the wait-and-retry admission path.
  • All unsubscribe tests and stale/closed-connection listener cases pass.
  • Realtime feature and operation tests consume the exact attached generation.

@winston-openai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 5368909df2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant