Skip to content

Commit

Permalink
Fix stack dump on shutdown (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-purplefish authored Nov 1, 2024
1 parent 95a90f0 commit 2ff2493
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-turtles-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-agents": patch
---

Fix stack dump on closed stream
6 changes: 5 additions & 1 deletion livekit-agents/livekit/agents/ipc/job_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ async def _async_main(
async def _read_ipc_task():
nonlocal job_task
while True:
msg = await channel.arecv_message(cch, proto.IPC_MESSAGES)
try:
msg = await channel.arecv_message(cch, proto.IPC_MESSAGES)
except duplex_unix.DuplexClosed:
break

with contextlib.suppress(utils.aio.SleepFinished):
no_msg_timeout.reset()

Expand Down

0 comments on commit 2ff2493

Please sign in to comment.