66 Bug/Enhancement: check_sp_output hangs indefinitely on frozen FFmpeg streams#67
Conversation
Add `DEFAULT_TIMEOUT_SUBPROCESS` env var and timeout handling in `check_sp_output` with graceful process kill on expiry. Pass timeout to device detection subprocess calls.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces environment-configurable subprocess timeouts, refactors ChangesSubprocess Timeout Support & Device Discovery Enhancement
Possibly Related Issues
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Increase default timeout value from 3.0 to 10.0 seconds and rename the constant to better reflect its purpose as a maximum allowed timeout.
Replace immediate `process.kill()` with a SIGTERM-first approach, waiting `TERMINATE_TIMEOUT_SUBPROCESS` seconds before escalating to SIGKILL. Adds `TERMINATE_TIMEOUT_SUBPROCESS` env-configurable constant (default 2s) and improves docstrings throughout `check_sp_output`.
Brief Description
The check_sp_output function should accept a timeout argument (via kwargs) to prevent indefinite hanging. If the timeout is reached, it should cleanly catch the subprocess.TimeoutExpired exception, terminate the process, flush the remaining buffer, and return the captured output without raising a CalledProcessError.
Requirements / Checklist
Related Issue
#66
Context
This PR introduces
timeoutargument (viakwargs) to prevent indefinite hanging incheck_sp_outputfunctionTypes of changes
Miscellaneous (if available):