Skip to content

[type: bug] Fix session key mismatch in streamable HTTP transport (#6833) - #6997

Open
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/6833-session-key
Open

[type: bug] Fix session key mismatch in streamable HTTP transport (#6833)#6997
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/6833-session-key

Conversation

@zhang-arvin

Copy link
Copy Markdown

Fixes #6833

Problem

ShenyuStreamableHttpServerTransportProvider.handleInitializeRequest creates a StreamableHttpSessionTransport with auto-generated UUID as sessionId, but stores sessions under McpServerSession.getId() (a different key). When close()/closeGracefully() calls removeSession(this.sessionId), it uses the auto-UUID, so nothing gets removed — sessions leak forever.

Fix

After creating the session, sync the transport's sessionId to match the McpServerSession's ID via a new setSessionId() method, ensuring close()/closeGracefully() correctly removes the session.

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.

[BUG] MCP Streamable-HTTP session cleanup uses wrong key (auto-UUID) — sessions leak forever

1 participant