collabora / WhisperLive

A nearly-live implementation of OpenAI's Whisper.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deadlock with pipe_stderr=True in FFmpeg subprocess

sondt2709 opened this issue · comments

Issue Summary:
When using subprocess in Python with pipe_stderr=True but not reading from it, there are potential issues related to blocking behavior.

Steps to Reproduce:

  1. Increase max_connection_time to more than 10 mins to make sure it doesn't relate to websocket.
  2. Print log above and below line in_bytes = process.stdout.read(self.chunk * 2) in client.py
  3. Prepare a HLS stream url (i.e: https://example.com/stream.m3u8)
  4. Run and wait about 10-12 minutes

Expected Behavior:
The subprocess should execute normally.

Actual Behavior:
Hang forever at line in_bytes = process.stdout.read(self.chunk * 2)

Suggested Fix:
Remove pipe_stderr=True or read stderr

Can I create a fix PR?

@sondt2709 feel free to open a PR with the Fix. thanks!