Skip to content

fix(runtime): quiesce core supervision during SCM preshutdown - #470

Closed
4o3F wants to merge 1 commit into
fix/windows-service-preshutdownfrom
fix/session-process-lifecycle
Closed

4o3F wants to merge 1 commit into
fix/windows-service-preshutdownfrom
fix/session-process-lifecycle

Conversation

@4o3F

@4o3F 4o3F commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Connects the process activity input from libnyanpasu/nyanpasu-utils#218 to managed core supervision, so the service's SCM Preshutdown pauses automatic core recovery and Windows stops kill the existing process tree without launching the Ctrl+C helper.

Stacks on #469. Depends on libnyanpasu/nyanpasu-utils#218. Refs libnyanpasu/clash-nyanpasu#6054.

Changes

  • Pin nyanpasu-utils to a3ec581 (U1).
  • Add optional process activity injection through CoreManagerBuilder, ProcessRuntimeBackend and InstanceBuilder into each supervisor: initial and replacement instances, recovery and shutdown. With no activity supplied, behavior is unchanged.
  • The service host owns the activity source. On Preshutdown it publishes an irreversible Quiescing before cancelling the shared shutdown token from fix(service): bound Windows preshutdown and preserve cancellation #469. A plain Stop stays graceful.
  • No changes to the IPC protocol or the CLI JSON output.

Verification

  • Both new regression tests failed before the change and pass after it.
  • WSL: 396 tests pass and 5 existing tests are ignored. clippy -D warnings, rustdoc and formatting pass. Cargo.lock is unchanged.
  • The Windows-gnu checks stop in the aws-lc-sys build script (no mingw), so the Windows code paths here have only been reviewed by hand.

Windows acceptance

The process-tree and helper tests are not in the CI matrix, so run these manually on Windows:

  • cargo test -p nyanpasu-utils --no-default-features --features process --test process_kill --test process_helper_smoke --test process_supervisor
  • the core-manager lifecycle tests
  • a real SCM Preshutdown/Stop check: Quiescing launches zero Ctrl+C helpers and kills the whole tree, and Stop stays graceful.

Follow-up

If #218 is squash-merged, re-pin nyanpasu-utils to the merged commit.

@semanticdiff-com

semanticdiff-com Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Service preshutdown must suppress automatic core recovery and avoid
launching the Ctrl+C helper while Windows is shutting down.

Pass the host-owned process activity reader through the manager,
process backend, and instance builders. Publish Quiescing before
cancelling the shared SCM shutdown token, while keeping Stop graceful.

Pin utils U1 and cover replacement, recovery, shutdown, and cancellation
ordering with regression tests.

Refs libnyanpasu/clash-nyanpasu#6054
@4o3F
4o3F force-pushed the fix/session-process-lifecycle branch from 8250238 to 1c531b4 Compare November 1, 2026 09:17
@4o3F
4o3F added this pull request to stack #471 November 1, 2026 09:17
@4o3F
4o3F requested a review from greenhat616 November 1, 2026 09:33
@4o3F 4o3F closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant