Commit Graph
7 Commits
Author SHA1 Message Date
YueGuobin 52c19002f2 fix: bound graceful shutdown and stop notification WebSockets on exit
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.
2026-11-04 00:32:34 +08:00
Mark Paronyan 83e7fbe63b style: sort imports in remaining tests and scripts 2026-10-02 12:43:26 +03:00
Mark Paronyan 06e98f8b55 style: drop redundant utf-8 coding declarations 2026-10-01 19:57:40 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
grossmj 8e96c4c2e8 Refactor command line arguments parsing 2025-01-17 07:57:42 +07:00
grossmj 9c456532d0 Pydantic v2 migration 2023-08-04 18:20:06 +10:00
grossmj 71725aade6 Rename ssl and auth configuration file settings.
Add enable SSL config validator.
Strict configuration file validation: any error will prevent the server to start.
Core server logic moved to a Server class.
2021-04-12 23:26:42 +09:30