fix: add timeout to subprocess.run() and proc.wait() calls
subprocess.run() and proc.wait() without timeout can hang indefinitely if the child process becomes unresponsive. This blocks the calling thread forever. Fixed locations: - tools/transcription_tools.py: ffmpeg conversion (timeout=300) and user-configured STT commands with shell=True (timeout=300) - gateway/run.py: helper script proc.wait() (timeout=3600) Not fixed: - agent/anthropic_adapter.py: interactive 'claude setup-token' — user-driven, timeout would be inappropriate
This commit is contained in:
+1
-1
@@ -15126,7 +15126,7 @@ class GatewayRunner:
|
||||
env["PYTHONUNBUFFERED"] = "1"
|
||||
with open(output_path, "wb") as f:
|
||||
proc = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT, env=env)
|
||||
rc = proc.wait()
|
||||
rc = proc.wait(timeout=3600)
|
||||
with open(exit_code_path, "w") as f:
|
||||
f.write(str(rc))
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user