Merge pull request #4186 from pipecat-ai/mb/fix-websocket-disconnect-race-condition

Fix FastAPI WebSocket disconnect race condition
This commit is contained in:
Aleix Conchillo Flaqué
2026-03-27 21:40:21 -07:00
committed by GitHub
3 changed files with 145 additions and 12 deletions

1
changelog/4186.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed `FastAPIWebsocketTransport` intermittently hanging on shutdown when the remote side (e.g. Twilio) disconnects while audio is being sent. A race condition between the send and receive paths could cause the `on_client_disconnected` callback to be skipped, leaving the pipeline waiting for a disconnect signal that never came.