Repository navigation
Conversation
Pause automatic failure recovery while the host is quiescing, preserving the remaining backoff and one deferred retry without spending extra budget. Read the same activity in supervisor stops and queued engine controls so Windows shutdown kills the existing tree without launching a Ctrl+C helper. Keep graceful stops for Active processes and preserve default behavior. Refs libnyanpasu/clash-nyanpasu#6054
Changed Files
|
|
Thanks for digging into libnyanpasu/clash-nyanpasu#6054. I'd like to narrow the scope of this PR. Shutdown should be irreversible at this layer. Once the host starts shutting down, the supervisor should finish stopping. If the session turns out not to end ( Restart suppression already exists: once the supervisor's token is cancelled it never respawns (both the backoff wait and the pre-spawn check observe it). That makes the following unnecessary:
What we do need is a host-chosen stop strategy, so that a session-end stop on Windows kills the tree instead of launching the Ctrl+C helper. Because a stop can come from cascading cancellation (the
Windows process tests still aren't in CI, so please run |
|
Closing: per maintainer decision, the session-end handling for libnyanpasu/clash-nyanpasu#6054 stays in the app's Tauri layer, so no process-supervisor change is needed here. Thanks for the review. |
Summary
Adds a revocable process "activity" input. A host can use it to pause automatic failure recovery during shutdown and to stop processes without starting any new ones. Part of libnyanpasu/clash-nyanpasu#6054.
Changes
ProcessActivitySource,ProcessActivityandProcessActivityState::{Active, Quiescing}, plusSupervisorBuilder::activity. Behavior is unchanged when no activity is supplied.Quiescing, the supervisor does not respawn after a failure. It keeps the remaining backoff, spends no extra restart budget, and performs one deferred retry after the state is revoked. Processes that exited cleanly are not resurrected.Quiescingkills the existing process tree directly, without launching the Ctrl+C helper.Activestops keep the graceful helper path.Verification
clippy -D warnings, rustdoc and crate formatting. The new tests failed before the fix.cargo +nightly check --target x86_64-pc-windows-gnu --all-targets --no-default-features --features processpasses, so the Windows code paths type-check.cargo fmt --all --checkfails only on the existinglog-preview/src/lib.rs.Needs Windows CI
The process tests are not in the Windows matrix yet; the current CI only runs the pid-file tests explicitly. Please run
process_supervisor,process_killandprocess_helper_smokeon Windows to confirm that aQuiescingstop kills descendants with zero helper calls and thatActivestops still use the helper.