Skip to content

Shut down superseded MCP managers on refresh - #29608

Merged
jif-oai merged 3 commits into
mainfrom
jif/shutdown-superseded-mcp-manager
Jun 23, 2026
Merged

Shut down superseded MCP managers on refresh#29608
jif-oai merged 3 commits into
mainfrom
jif/shutdown-superseded-mcp-manager

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

MCP refresh replaced the published connection manager without shutting down the manager it superseded. If another task retained that old manager, its stdio MCP processes stayed alive and accumulated across refreshes.

Atomically swap in the refreshed manager, then explicitly shut down the exact manager returned by the swap. Add a process-level regression test that retains the old manager during refresh and verifies its stdio process exits while the replacement remains available.

Context

Explicit cleanup was lost when manager publication moved to ArcSwap. Dropping the old manager is not a reliable shutdown boundary because active callers can retain its Arc and underlying client process handles.

@jif-oai
jif-oai requested a review from a team as a code owner June 23, 2026 10:30
@jif-oai

jif-oai commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 7c995913d3

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jif-oai

jif-oai commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 4efec8ba74

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jif-oai
jif-oai merged commit 8751fd3 into main Jun 23, 2026
30 of 31 checks passed
@jif-oai
jif-oai deleted the jif/shutdown-superseded-mcp-manager branch June 23, 2026 17:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

1 participant