Skip to content

fix(core-manager): sweep stale records whose pid was reused - #462

Merged
greenhat616 merged 1 commit into
mainfrom
fix/stale-pid-reuse
Oct 28, 2026
Merged

greenhat616 merged 1 commit into
mainfrom
fix/stale-pid-reuse

Conversation

@greenhat616

Copy link
Copy Markdown
Collaborator

Depends on libnyanpasu/nyanpasu-utils#209 — merge that first. The gitlink here points at its head 573d792, which stays reachable after a standard merge.

Fixes the runtime side of libnyanpasu/clash-nyanpasu#6033.

Problem

CoreManager construction sweeps leftover epoch records. When a record's pid had been reused by an unrelated process, the reaper returned "cannot prove ownership of live pid", construction failed, the GUI host panicked in setup, and the service daemon could not start until the record was deleted by hand.

Change

  • Bump nyanpasu-utils to 0.1.1, which retires a record whose start token differs from the live process without signaling it (including another user's process on Linux and macOS). The bump also brings the dirs 7 update already on utils main.
  • Regression test manager_sweeps_a_stale_record_whose_pid_was_reused: a stale record points at the running test process with another start token; construction succeeds and the epoch artifacts are swept.
  • README: proven pid reuse no longer fails construction; unprovable identity still does.
  • CI runs the sweep tests.

Verified on Linux (WSL): both sweep tests pass; no new Clippy warnings in the changed files.

After merging, v2.0.2 needs to be published through the publish workflow so the app can pin it together with the service sidecar.

@semanticdiff-com

semanticdiff-com Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/ci.yml  0% smaller
  Cargo.lock Unsupported file format
  crates/nyanpasu-core-manager/README.md Unsupported file format
  crates/nyanpasu-core-manager/tests/manager_orchestration.rs  0% smaller
  crates/nyanpasu-utils  0% smaller

CoreManager construction sweeps leftover epoch records and failed when a
record's pid had been reused by an unrelated process, because the reaper
could not prove ownership of the live pid. The GUI host panicked during
setup and the service daemon could not start until the record was
deleted by hand (clash-nyanpasu#6033).

nyanpasu-utils 0.1.1 retires a record whose start token differs from the
live process without signaling it, including processes of other users on
Linux and macOS. Bumping it also brings the dirs 7 update already on its
main branch.

The regression test points a stale record at the running test process
with another start token; CI now runs the sweep tests.
@greenhat616
greenhat616 merged commit 90cf8c6 into main Oct 28, 2026
11 checks passed
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