Close server session after handle stateless request by hopeful0 · Pull Request #1116 · modelcontextprotocol/python-sdk
hopeful0
deleted the
stateless-server-session-close
branch
felixweinberger added a commit that referenced this pull request
Jul 14, 2025This test verifies that PR #1116's fix properly cleans up transport resources for stateless requests. The test mocks StreamableHTTPServerTransport to track when _terminate_session() is called and ensures it's invoked for each stateless request to prevent memory leaks. Without the fix (commenting out the _terminate_session() call), this test fails, confirming it properly detects the memory leak issue. Github-Issue:#1116
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