Skip to content

Conversation

@fgrosse
Copy link
Contributor

@fgrosse fgrosse commented Sep 18, 2025

Fixes: #478

Copy link
Contributor

@jba jba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please un-draft this.


handler := NewStreamableHTTPHandler(func(*http.Request) *Server { return server }, &StreamableHTTPOptions{
server := NewServer(testImpl, &ServerOptions{
KeepAlive: 10 * time.Millisecond,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is KeepAlive being set here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you already resolved this but just for future reference: this is an artifact of moving code around (i.e., the keep alive was there already).

I was wondering about this separately when debugging leaking goroutines and flakyness and it took me some time to realize that the keep alive here is used as a way to make the server close the connection with the client (because it would fail the keep alive after 10ms). This is necessary in this test because of the bug that transport cleanup does not happen even when the client closes the connection itself (which does happen in this test).

When we merge #480 we can actually improve this test and remove the keepalive.

@jba jba marked this pull request as ready for review September 18, 2025 16:20
@jba
Copy link
Contributor

jba commented Sep 18, 2025

Never mind, I did it.

@jba jba merged commit 02f0b25 into modelcontextprotocol:main Sep 18, 2025
5 checks passed
@fgrosse fgrosse deleted the fgrosse/478-get-session-id branch September 18, 2025 17:57
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.

Proposal: Move GetSessionID closure into ServerOptions

2 participants