An idle Streamable HTTP GET currently sends neither status nor headers until the first SSE event, causing clients to time out when keep-alive is disabled. Flush the servlet response after registering the listening stream so clients receive HTTP 200 and Content-Type: text/event-stream immediately.
Adds an embedded-Tomcat regression test with keep-alive disabled. The test timed out before the fix and passes with it.
Regression test: passed after reproducing the failure before the fix.
HttpServletStreamableIntegrationTests: all 54 tests passed.
mvnw.cmd -pl mcp-core,mcp-test -am test: core and Jackson modules passed; mcp-test ran 823 tests with 13 errors, including unavailable Docker/dependent initialization errors and a stdio timeout. The broader suite is not fully green in this environment.
Tested with Java 17 and embedded Tomcat 11.0.2; the reporter's exact JDK/Tomcat versions were not reproduced.
Formatting validation and git diff --check passed.
This is an AI-assisted contribution. The required repository-policy disclosure is included in disclosure.txt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An idle Streamable HTTP GET currently sends neither status nor headers until the first SSE event, causing clients to time out when keep-alive is disabled. Flush the servlet response after registering the listening stream so clients receive HTTP 200 and Content-Type: text/event-stream immediately.
Adds an embedded-Tomcat regression test with keep-alive disabled. The test timed out before the fix and passes with it.
Fixes #1155.
Validation:
This is an AI-assisted contribution. The required repository-policy disclosure is included in disclosure.txt.