Files
Max Isbey 7e091ba7be fix: bound uvicorn graceful shutdown so thread.join doesn't abandon it mid-drain
Without timeout_graceful_shutdown, uvicorn's shutdown() waits indefinitely
for open connections to close. The SSE reconnection tests in
test_streamable_http.py can leave streams open at fixture teardown, so
the 5s thread.join times out and abandons the thread mid-shutdown.

On Windows Proactor, the abandoned connection transports still have
pending Overlapped Recv operations when the event loop is torn down.
GC later finds them during an unrelated test, surfacing as
PytestUnraisableExceptionWarning. Previously hidden by subprocess
isolation.

timeout_graceful_shutdown=1 gives uvicorn a bounded window to drain
connections, then cancels remaining tasks via asyncio — transports
unwind through CancelledError instead of being abandoned.
2026-03-18 16:04:37 +00:00
..
2024-09-24 22:04:19 +01:00
2025-02-05 11:02:51 +00:00