Commit Graph
14 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 634189d443 style: sort imports in api and utils modules 2026-10-02 12:43:26 +03:00
Mark Paronyan 0f66fd6c2b style: remove trailing whitespace 2026-10-01 19:57:41 +03:00
Mark Paronyan 5fb2c277a9 fix(typing): resolve mypy errors in api.routes.compute.notifications 2026-09-29 08:48:04 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
grossmj 31c7fe88f1 Remove websocket.close() 2024-03-16 16:00:27 +01:00
grossmj 44c066ac68 Fix compute authentication for websocket endpoints 2023-10-22 12:44:39 +10:00
grossmj 4b791d4924 Fix websocket compute notifications after upgrade to FastAPI 0.97.0 2023-06-23 23:26:08 +09:30
grossmj 01a9e83f08 Ignore OSError when closing websocket 2021-12-08 00:00:54 +10:30
grossmj 38388f7ae5 Secure controller to compute communication using HTTP basic authentication 2021-11-18 18:37:10 +10:30
grossmj 9404c00411 Complete type annotations for API endpoints. 2021-04-18 15:40:38 +09:30
grossmj c021e21309 Use black with -l 120 param. 2021-04-13 18:46:50 +09:30
grossmj f928738bd5 Use pyupgrade with --py36-plus param. 2021-04-13 18:37:58 +09:30
grossmj c043830e3f Move endpoints to routes & preparations to use a database. 2020-11-19 15:21:03 +10:30