mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-19 20:55:14 +02:00
By default uvicorn waits for open connections forever. A long-lived streaming response keeps the server waiting after Ctrl+C. One common case is the MCP Streamable HTTP transport: the client opens a standalone GET request and the server answers with an SSE stream (not the old SSE transport). A second Ctrl+C sets force_exit. Uvicorn then skips the lifespan shutdown, so project and controller cleanup does not run. Add timeout_graceful_shutdown. After the timeout uvicorn cancels the remaining tasks and runs the lifespan shutdown. Also make the four notification WebSocket handlers stop when app.state.exiting is set. The HTTP stream handlers already do this.