-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Docker: Video recording starts via session capability se:recordVideo #3131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| import signal | ||
| import subprocess | ||
| import sys | ||
| import time | ||
|
|
||
|
|
||
| def _signal_supervisord() -> None: | ||
|
|
@@ -83,22 +84,32 @@ def _mark_external_shutdown(signum, frame): | |
|
|
||
|
|
||
| def _run_shell_recorder(): | ||
| record_video = os.environ.get("SE_RECORD_VIDEO", "true").lower() == "true" | ||
| per_session_mode = os.environ.get("SE_VIDEO_FILE_NAME", "") == "auto" | ||
|
|
||
| if not record_video and not per_session_mode: | ||
| print("[video.recorder] - SE_RECORD_VIDEO is disabled and SE_VIDEO_FILE_NAME is not 'auto', idling.") | ||
| try: | ||
|
Comment on lines
+87
to
+92
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. File_name bypasses recorder gating In shell mode, video_recorder._run_shell_recorder() decides whether to idle using only SE_VIDEO_FILE_NAME, but video.sh uses FILE_NAME to override the effective filename/mode. This mismatch can make recording start in fixed-file mode even with SE_RECORD_VIDEO=false (bypassing capability-based gating) or make the recorder idle when video.sh would run per-session mode. Agent Prompt
|
||
| while True: | ||
| time.sleep(60) | ||
| except KeyboardInterrupt: | ||
| pass | ||
| return | ||
|
Comment on lines
+92
to
+97
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. keyboardinterrupt swallowed in idle In the new idle path, KeyboardInterrupt is caught and ignored, causing SIGINT to exit cleanly instead of preserving default interrupt termination semantics. This violates the requirement that pre-async SIGINT handling must not be swallowed, and can misclassify external shutdown as a normal exit. Agent Prompt
|
||
|
|
||
| proc = subprocess.Popen(["/opt/bin/video.sh"]) | ||
| _external_shutdown = False # True when supervisord (or user) told us to stop | ||
|
|
||
| def forward_signal(signum, frame): | ||
| nonlocal _external_shutdown | ||
| # Forward the signal to video.sh at most once. supervisord uses | ||
| # killasgroup=true so video.sh already received the signal directly; | ||
| # re-forwarding on every re-entrant call amplifies the SIGTERM | ||
| # ping-pong and can keep the process alive for 60 s. | ||
| if not _external_shutdown: | ||
| _external_shutdown = True | ||
| try: | ||
| proc.send_signal(signum) | ||
| except ProcessLookupError: | ||
| pass # Process already exited before signal was forwarded | ||
| proc.wait() | ||
| pass | ||
| # Do NOT call proc.wait() here — blocking inside a signal handler | ||
| # interferes with bash's deferred-signal queue. The main-flow | ||
| # proc.wait() below resumes automatically after this returns (PEP 475). | ||
|
|
||
| signal.signal(signal.SIGTERM, forward_signal) | ||
| signal.signal(signal.SIGINT, forward_signal) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. Uploader busy-waits when disabled
🐞 Bug➹ PerformanceAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools