fix: reap zombie subprocesses in web_server action status and meet_bot cleanup

- web_server.py: after proc.poll() returns a non-None exit code, call
  proc.wait() to reap the child and move the entry from _ACTION_PROCS
  to _ACTION_RESULTS. Previously .poll() alone left <defunct> zombies.
- meet_bot.py: terminate and wait on the pcm_pump subprocess (paplay/
  ffmpeg) during the finally-block teardown. Previously leaked on every
  normal bot exit.
- tests: add test_action_status_reaps_completed_process and
  test_action_status_ignores_wait_failure covering both the happy path
  and the wait()-raises-OSError edge case.

Closes #38032
This commit is contained in:
islam666
2026-06-07 21:50:57 -07:00
committed by Teknium
parent e53b74c394
commit 78e2101cd2
3 changed files with 77 additions and 1 deletions
+7 -1
View File
@@ -699,7 +699,13 @@ def run_bot() -> int: # noqa: C901 — orchestration, explicit branches
context.close()
browser.close()
# v2: teardown realtime speaker + audio bridge.
# v2: teardown PCM pump, speaker thread, and audio bridge.
if rt.get("pcm_pump"):
try:
rt["pcm_pump"].terminate()
rt["pcm_pump"].wait(timeout=3)
except Exception:
pass
if rt["speaker_stop"]:
try:
rt["speaker_stop"]()