Skip to content

fix: propagate stdio process exit during initialization#960

Open
DragonFSKY wants to merge 1 commit into
modelcontextprotocol:mainfrom
DragonFSKY:fix/959-stdio-process-exit
Open

fix: propagate stdio process exit during initialization#960
DragonFSKY wants to merge 1 commit into
modelcontextprotocol:mainfrom
DragonFSKY:fix/959-stdio-process-exit

Conversation

@DragonFSKY

Copy link
Copy Markdown

Summary

  • Detect unexpected stdio process exit after the child process has started.
  • Propagate that stdio exit to an in-progress initialization instead of waiting for the request timeout.
  • Preserve generic transport exception behavior and add regression coverage for a stdio server that exits before initialize.

Fixes #959

Notes

This keeps the scope limited to process exits that happen after ProcessBuilder.start() succeeds and before initialization completes. It does not change startup failures or normal stdio shutdown behavior.

A stdio-specific McpStdioServerProcessExitException is used so this initialization fast-fail path does not apply to generic transport exceptions from other transports.

Test Plan

  • ./mvnw -pl mcp-core,mcp-test spring-javaformat:apply
  • ./mvnw -pl mcp-core test
  • ./mvnw -pl mcp-test -am test -Dtest=StdioMcpClientInitializationFailureTests -Dsurefire.failIfNoSpecifiedTests=false
  • ./mvnw -pl mcp-test -am test -Dtest=HttpClientStreamableHttpAsyncClientResiliencyTests#testPing -Dsurefire.failIfNoSpecifiedTests=false
  • ./mvnw clean test (local run reached mcp-test and failed in HTTP/Testcontainers resiliency/security integration tests; I did not count the full suite as passing)
Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
@DragonFSKY DragonFSKY force-pushed the fix/959-stdio-process-exit branch from a1c7e0f to 1c7a13f Compare June 30, 2026 03:24
@DragonFSKY DragonFSKY marked this pull request as ready for review June 30, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant