We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 694cabc commit a804442Copy full SHA for a804442
src/mcp/server/streamable_http_manager.py
@@ -250,14 +250,18 @@ async def run_server(
250
exc_info=True,
251
)
252
finally:
253
- # Cleanup logic
+ # Only remove from instances if not terminated
254
if (
255
http_transport.mcp_session_id
256
and http_transport.mcp_session_id
257
in self._server_instances
258
+ and not (
259
+ hasattr(http_transport, "_terminated")
260
+ and http_transport._terminated
261
+ )
262
):
263
logger.info(
- "Cleaning up crashed/terminated session "
264
+ "Cleaning up crashed session "
265
f"{http_transport.mcp_session_id} from "
266
"active instances."
267
0 commit comments