-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
In app/services/download_manager.py, the download_video function iterates over process.stdout in a synchronous for loop before calling process.wait(timeout=3600).
for line in process.stdout or []:
last_line = line
...
process.wait(timeout=3600)Impact
If yt-dlp hangs and stops emitting output without closing stdout (e.g., due to network stall), the for line in process.stdout loop will block indefinitely. The 3600s timeout on process.wait() will never be triggered because it only executes after the stdout loop finishes. This leads to a deadlock where the celery worker gets permanently stuck.
Suggested Fix
Use asynchronous reading for stdout, or use subprocess.run with a timeout and a background thread, or check elapsed time inside the loop with non-blocking reads.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working