Skip to content

app-server: reserve running resumes before idle unload#31392

Open
winston-openai wants to merge 1 commit into
dev/winston/app-server-idle-snapshot-prepfrom
dev/winston/app-server-resume-idle-admission
Open

app-server: reserve running resumes before idle unload#31392
winston-openai wants to merge 1 commit into
dev/winston/app-server-idle-snapshot-prepfrom
dev/winston/app-server-resume-idle-admission

Conversation

@winston-openai

Copy link
Copy Markdown
Contributor

Summary

Reserve a running thread/resume against idle unload before its listener command is enqueued. The reservation is keyed by an opaque per-request token, remains active while the primary response is delivered, and is committed to a subscription or canceled by a tracked supervisor after the listener reports the exact outcome.

Idle unload now takes the global thread-list permit and rechecks both committed connections and pending resume reservations before claiming the thread. Disconnect and unsubscribe cleanup retain bookkeeping until the last real subscription or reservation is gone.

This closes the gap where an idle listener could begin unloading a loaded thread between resume admission and listener subscription. Exact tokens also prevent a delayed completion from an older resume from consuming or subscribing a newer request on the same connection.

Stacked on #31388.

Validation

  • Focused lifecycle regressions cover stale-token replacement and disconnect while another connection has a pending reservation.
  • The existing public running-resume integration test passes through the updated listener response path.
  • The thread-state suite covers listener shutdown and connection bookkeeping with the new reservation supervisor.

@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. Delightful!

Reviewed commit: 0ce1cd8c76

ℹ️ 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