Repository navigation
Conversation
Automated AI review
Verified: the longer grace period works as described for recorders that need between 5 and 30 seconds to exit after SIGINT. With a stubbed recorder that needs 8 s, the base force-kills it at about 5.4 s with the "force-killed" toast, while this head waits about 8.1 s, runs the normal finalize step and shows the "saved" toast. A recorder that exits promptly is unaffected, because the loop ends at the first Two issues remain in the new code path, plus a note on the scope of "Closes #12469". Leading-zero and very large timeout values bypass the fallback
Impact: a user who writes a padded value such as Suggested change: force base 10 and cap the value before multiplying, for example (untested sketch): [[ $timeout_s =~ ^[0-9]{1,5}$ ]] || timeout_s=30
timeout_s=$((10#$timeout_s))
((timeout_s < 1)) && timeout_s=1A second stop during the longer wait runs a concurrent finalizeWhile The race already exists on the base (there it produces a "force-killed" error next to a "saved" toast with an empty path), but the window grows from 5 s to 30 s, and it opens in exactly the slow case this PR targets. Whether real ffmpeg output is corrupted by the two writers was not tested; the duplicate concurrent processing was observed with stubs. Impact: a user who presses stop again because nothing seems to happen gets duplicate processing of the same recording and contradictory or duplicate notifications. Suggested change: serialize the stop path (for example Scope of "Closes #12469"In gpu-screen-recorder 6.1.0 (source read at the tag), SIGINT only clears a running flag, and the main loop checks that flag between iterations. With Omarchy's Suggested change: describe the PR as mitigating #12469 rather than closing it, or confirm on the affected machine first. Documentation note: Review informationTest scope: Source review of the pinned head against its merge-base, including callers (keybinding, menu, bar indicator, webcam wrapper) and gpu-screen-recorder 6.1.0 source. Stop-path behavior was exercised in isolated sandboxes with stubbed AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with a targeted follow-up on the gpu-screen-recorder stop path, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Force base-10 and bound OMARCHY_SCREENRECORD_STOP_TIMEOUT so leading zeros are not treated as octal and huge values cannot overflow the wait loop. Document the env var next to the other screenrecord knobs.
|
Thanks for the careful sandbox review — appreciated. Pushed a follow-up that hardens On the rest:
Happy to adjust further if maintainers prefer different bounds or want the flock path in this PR. |
Automated AI review
Follow-up to the earlier review and the author's reply, checked at head Outcome: the timeout parsing issue, the "Closes #12469" scope note and the documentation note are resolved. The concurrent second stop is still present, and the author has deferred it to a separate change. One newly found edge remains in the parsing: timeout values written with non-ASCII digits abort the stop in some glibc UTF-8 locales such as
Timeout parsingVerified: every value from the earlier table now either parses as decimal or falls back to 30 s, and stays within 1 to 600 s. The recorder stub keeps running after SIGINT, so each wait below is the loop bound (loop iterations × 0.1 s, not wall-clock time):
The earlier Verified results still hold on this head:
The keybinding, menu, bar indicator and webcam wrapper all reach the same stop branch, so they get the same exit status and toasts. For ASCII input, results were identical in the Documentation note: the header's "oversized digit strings" could say "more than five digits", because Non-ASCII digits pass the check and abort the stop (newly found)In a glibc UTF-8 locale such as The same class of failure was already present in Impact: only a value written with non-ASCII digits (for example, typed with a CJK input method) triggers it. Every stop then skips post-processing and the toast, and ALT+PRINT falls through to the capture menu. The recorder has already received SIGINT, so a real gpu-screen-recorder probably still writes its file. That part was not tested. Suggested change: use Second stop during the wait (still present)The stop path after the parsing block is unchanged. On this head, with stubs, the recorder needed 8 s and a second stop started 1 s after the first. Both stops then finalized the same recording: two Impact: the same as in the earlier review: pressing stop again during a slow shutdown leads to duplicate processing and duplicate toasts. Suggested change: a separate change, as the author proposes, is a reasonable scope. Open #11520 already adds a non-blocking Related open PRs: #13362 and #10397 also rewrite this stop loop. #13362 replaces the Review informationTest scope: Source review of head AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical follow-up review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Locale-aware [0-9] can match fullwidth/Arabic-Indic digits under glibc UTF-8 locales; 10# then fails and aborts stop after SIGINT. Match explicit ASCII 0-9 only.
|
Thanks for the follow-up — good catch on locale Pushed a fix that matches explicit ASCII Still leaving the concurrent second-stop / flock + “Finishing…” toast to a separate change (and happy to coordinate with #11520 if maintainers prefer). Related stop rewrites in #13362 / #10397 noted — will rebase as needed when those land. |
Automated AI review
Follow-up to the previous review and the author's reply, checked at head Outcome: Verified on
Timeout parsingVerified: Running the script's stop path with stubs in
For all ASCII values, including Related open PRsThe previous note on #11520, #13362 and #10397 still applies. Three details for whoever resolves the overlap:
Review informationTest scope: Source review of head AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical follow-up review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for re-verifying on Still holding the concurrent second-stop / flock + “Finishing…” toast for a follow-up (and will align with #11520 / rebase against #13362 or #10397 if those land first). No further code changes planned on this PR unless maintainers want that bundled. |
What
stop_screenrecording()used to SIGINTgpu-screen-recorderand then SIGKILL after a flat 5s. On a loaded or thermally throttled machine the muxer cannot write the MP4 trailer in that window, so the file is truncated (issue #12469).Wait 30s by default (still a hard cap), overridable with
OMARCHY_SCREENRECORD_STOP_TIMEOUT. Invalid values fall back to 30: non-digits, empty, and digit strings outside 1..5 length; accepted values are forced base-10 and clamped to 1..600.Why
Reproduce without needing a slow machine: start a recording,
pkill -STOPthe recorder, then--stop-recording. Five seconds later the force-kill toast fires and the file is cut. Raising the grace period is the smallest change that matches the reported trailer-write failure mode.Mitigates #12469 (longer post-SIGINT grace). Does not restore video that was already behind the container timeline while recording under
-fm cfr; that path needs separate diagnosis withOMARCHY_SCREENRECORD_DEBUG=true/ packet endpoints.Test
CLI-only; no VM screenshots.
./test/cli/./test/shellnot run here (no local Omarchy tree on this host). The wait loop is the same shape as before; timeout parsing forces base-10 ASCII digits only (1..5 chars), clamps 1..600, and falls back to 30 for non-ASCII digits or longer digit strings.