Repository navigation
feat(desktop): hand the stop deadline to ocx stop and read the Windows stop reasons (#7771 slice 3) - #8560
Conversation
…s stop reasons Desktop's two ocx stop children now receive their deadline as OCX_STOP_DEADLINE_MS (decimal milliseconds from the child's start): the consented takeover passes the remaining startup deadline minus 5 s, the exit/restart drain passes its deadline minus 3 s, and a value that would not be positive is not set. An older CLI ignores the variable, so mixed Desktop/CLI versions keep today's behavior. The exit/restart drain deadline is 75 s on Windows (30 s elsewhere), so a registered service's checked stop fits. StopSummary reads the additive serviceStopReason and portHeldByForeign fields with serde(default). They change no verdict and add no Outcome or Proxy value; they append an actionable sentence to the stop description (elevated terminal, retry from a terminal, wrapper started outside the service, unreadable process state, another program on the port). Older documents read exactly as before and an unknown reason is tolerated. Refs #7771
…portHeldByForeign Refs #7771
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. Walkthrough
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Maintainer judgment (#7771 Option B, slice 3: Desktop)
|
Summary
Slice 3 of 3 for #7771 Option B (owner-approved design in
devlog/_plan/261111_windows_service_stop/): the Desktop side. It is safe to merge before the CLI slices, because it only passes information a CLI that does not know it ignores, and only reads fields an older CLI leaves out.ocx stopchildren (the consented takeover at startup and the exit/restart drain) now receiveOCX_STOP_DEADLINE_MS, measured just before the spawn: the remaining startup deadline minus 5 s for the takeover (the silence probe andclaim::runstill run under that deadline), the drain deadline minus 3 s for the drain. When nothing positive is left the variable is set to an empty value, which means "no deadline", so a value inherited from Desktop's own environment can never reach the child. The design names a--deadline-msflag; the CLI slice accepts both, and Desktop uses only the environment variable because an older CLI rejects an unknown flag.runtime_stop::DEADLINEis 75 s on Windows (72 s handed to the CLI) and stays 30 s elsewhere, so a checked Windows stop that waits for the port fits (030's budget: 56 s worst case + pre-admission allowance + two inherited receipts = 70 s).ocx-stop/1fields:StopSummaryreads the additiveserviceStopReason(access-denied, evidence-unreadable, unbound-wrapper, unverified-budget; unknown strings kept) andportHeldByForeign(absent ornull= false), bothserde(default), nodeny_unknown_fields, no newOutcome/Proxyvalue. They add one plain sentence to the stop description (elevated terminal, retry from a terminal, a wrapper started outside the service, unreadable process state, another program holds the port) and never change the verdict.structure/ops/desktop-supervision.md(hand-off, 75 s, fields),structure/desktop-shell.md(named the drain deadline correctly), and 030/050 of the design now say Desktop uses the environment variable.Refs #7771.
Verification
portHeldByForeigntrue/false/null, hand-off values incl. the omitted and sub-millisecond edges, 75 s vs 30 s) failed to compile on the unchanged code (missing helpers and fields) and pass now.cargo test --libfordesktop/src-tauri: 309 passed, 0 failed, 2 ignored.cargo clippy --all-targets -- -D warningsandcargo fmt --check: clean. Local macOS build needed a scratch shim for the Swift NativeTray step (Command Line Tools without Xcode) and the CI "prepare desktop check resources" placeholders; no test touches the tray.bun run privacy:scan,bun run structure:check: pass.NOT RUN:
cargo check --target x86_64-pc-windows-msvc(needs Windows SDK headers); the Windows value is covered throughdrain_deadline_for(true).Checklist
Summary by CodeRabbit