Repository navigation
frontend: Restore --disable-shutdown-check - #810
Conversation
|
Thanks for the PR and the end-to-end check. Rebased onto master, set
|
d978016 to
b98c11b
Compare
Move the decision whether to show the "Crash Detected" dialog into frontend/utility/unclean-launch.hpp (decideUncleanLaunch), free of Qt, and add test_unclean_launch. No change in behaviour. RED for obs-rust#809: the case "unclean shutdown + --disable-shutdown-check" fails, because the helper still shows the prompt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
OBS 32.0 removed the flag (de997b1). After an unclean shutdown, an unattended start (systemd unit, headless X, kiosk, container) then blocks forever on the modal "Crash Detected" dialog. With --disable-shutdown-check, OBS logs the unclean shutdown as a warning and launches in normal mode, without the dialog and without a crash log upload. Without the flag, the behaviour does not change. The flag is listed in --help again. GREEN for obs-rust#809 (upstream obsproject/obs-studio#12650). Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd secs=1367 lanes=lint:run,rust-test:reused@241456d52183,cross:reused@b456eff62019,tier2-linux:run Ci-Attestation: {"at":1792064466,"gate":"rust/all/fmt","host":"linux-x86_64","key":"70c3e12a6c7699758a5a5aa18481b4b98881437cb0ddc179b9075912d57ce4f8","lane":"lint","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":57,"stamp":"bb5ccb847d00dc35efbd047c93d698f5","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"run"} Ci-Attestation: {"at":1792064466,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"70c3e12a6c7699758a5a5aa18481b4b98881437cb0ddc179b9075912d57ce4f8","lane":"lint","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":57,"stamp":"5a6cf315cc8b05ad32edca78b6a316d4","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"run"} Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"241456d52183502cf4b88cfa70413b65dfc08dc645f90e8d74ed72769dac7fe4","lane":"rust-test","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"666786332af5ec80ad356e838cac5ab5","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"052a7c910d2b3a22d878cbf6fc065df9","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"154247a3d324149ea0bdeb88ab116634","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792052374,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"0f195b38816f63f0a8c2fcfee5151f26","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792052374,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"f49ff0069782a81ac9d296091d3ff82d","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"177bb35a70786fa08588f4ac32c6d16e","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"1745d46250f02e586d167bae850aba45","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"} Ci-Attestation: {"at":1792064466,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"7a7de4269b1cc5abc67a9021dbd420197165f50656ab9c9a50330c3151551a18","lane":"tier2-linux","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":1310,"stamp":"73366a6141493b32b371810f51280001","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"run"}
|
Rebased onto master again: #816 merged first and added a neighbouring include in |
b98c11b to
c6b031e
Compare
|
I have no objection to restoring the flag to handle edge cases, but did the underlying problem get fixed? The real issue is that the OS issuing a shutdown does not trigger a clean exit of OBS. It should. If the system shutting down or the process manager asking for a termination (obviously not a hard kill, just a stop request) would inspire OBS to do a clean shutdown this flag would barely be needed. It's mostly being used as a bandaid for not having a way for the OS to initiate a clean shutdown. |
|
@alerque Agreed, a stop request must give a clean exit, and in this fork it does: Some background on why the flag is still needed. Quite a few production setups ran OBS headless with A clean shutdown cannot be guaranteed. Power loss, the OOM killer, a SIGKILL after the stop timeout, a hard stop of the VM or container, or a real crash all leave the sentinel behind. On a desktop the prompt is useful. On a headless machine nobody can click it, so OBS waits forever: the service shows as running, but no output starts and the websocket never opens. These setups need OBS to come back by itself after an unclean stop. With the flag it does, and the unclean shutdown stays visible as a warning on log line 1. If a flag is the wrong shape long term, one alternative would be a prompt that continues on its own after a timeout (and selects Safe Mode after several unclean starts in a row). That would make the flag mostly unnecessary. |
|
Oh trust me I know all about managing headless devices and understand why the flag is needed and removing it was short sighted of upstream OBS. As long as there are any lock files are other run-time artifacts being created having an override to run again in the event they don't get cleaned up is a must. |
|
Agreed on all of it, and thanks: your question made me check that the fork already exits cleanly on SIGTERM/SIGINT/SIGQUIT, so the flag now only covers the cases where a clean exit is impossible. For context on why I care: I run OBS headless on purpose, and I'm clearly not the only one. I wrote up the bigger picture and what already works in the fork here: #1078 |
Fixes #809
What and why
OBS 32.0 removed
--disable-shutdown-check(upstream de997b1; upstream report obsproject/obs-studio#12650, closed as not planned). After an unclean shutdown, the next start shows the modal "Crash Detected" dialog and waits. On an unattended host (systemd unit, headless X, kiosk, container), nobody can answer it. OBS then stays blocked with no websocket and no outputs.This PR restores the flag:
--disable-shutdown-check, OBS logs the unclean shutdown as a warning and launches in normal mode. It does not show the dialog and does not upload a crash log. The crash stays visible in the log.--helplists the flag again.The decision is in a new Qt-free header,
frontend/utility/unclean-launch.hpp(decideUncleanLaunch()).OBSApp::checkForUncleanShutdown()uses it, and a cmocka test covers it without a display.RED → GREEN
test_unclean_launch: 1 of 4 cases fails (unclean_with_flag_skips_prompt, the prompt is still shown). The other 3 cases pass.test_unclean_launch4/4.End-to-end check (not part of CI), on Debian 13, headless Xorg on :1, OBS started by a systemd unit with
--disable-shutdown-check:systemctl kill -s KILL <unit>, then start the unit again.Crash or unclean shutdown detectedand the dialog is open; the websocket port does not open.Crash or unclean shutdown detected; prompt skipped (--disable-shutdown-check), launching normally. The websocket starts and the canvas renders at the full frame rate.Checklist
master(or the description starts with a Stacked: note)-W..., ratchets): none (--disable-shutdown-checkis a command-line option, not a compiler flag)Notes:
./lintand the local gate were not run.🤖 Generated with Claude Code