Skip to content

fix(self-update): stop a non-elevated repair from fabricating a broker failure#461

Merged
githubrobbi merged 1 commit into
mainfrom
fix/update-repair-false-broker-failure
Jun 19, 2026
Merged

fix(self-update): stop a non-elevated repair from fabricating a broker failure#461
githubrobbi merged 1 commit into
mainfrom
fix/update-repair-false-broker-failure

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

Symptom

uffs --update repair (run non-elevated — by design; the Access Broker exists precisely so the daemon/updater run without UAC) reports a hard failure for a broker that is perfectly healthy:

[FAIL] Service restart failed   broker
[ OK ] Broker pipe serving          ← same report!
summary: 11 ok, 0 warning(s), 1 failure(s)   → exit 1

Confirmed healthy out-of-band: uffs-broker --statusState: running, PID 1536, Pipe: serving.

Root cause

The broker runs as a LocalSystem service. A non-elevated uffs-update can't OpenProcess a SYSTEM-owned PID, so proc::is_alive(pid) false-negatives → the broker is flagged "down" → restore tries to uffs_winsvc::start it → that also needs elevation → fails → hard [FAIL]. The broker was up the whole time.

Fix (two surgical changes)

  • doctor check_services: judge the broker's liveness by its serving pipe (the authoritative signal check_broker already uses), not by PID OpenProcess liveness. A serving broker reads Service up: broker and never enters the down/restart path.
  • restore start_broker: make it idempotent — already serving ⇒ return success without an elevation-gated uffs_winsvc::start. Also hardens the quiesce→restore path.

Net: a non-elevated repair/restore no longer invents a broker failure when the broker is up; it only acts when the pipe is genuinely not serving.

Verification

Builds + 46 uffs-update tests green, clippy clean, x86_64-pc-windows-msvc cross-compile OK.

🤖 Generated with Claude Code

…r failure

`uffs --update repair` (which runs NON-elevated by design — the whole point
of the Access Broker) reported `[FAIL] Service restart failed: broker` while
the very same report showed `[OK] Broker pipe serving`. The broker was
healthy the entire time (confirmed: `uffs-broker --status` → running, serving).

Root cause: the broker runs as a LocalSystem service. A non-elevated
uffs-update cannot `OpenProcess` a SYSTEM-owned pid, so `proc::is_alive(pid)`
false-negatives on it → the broker is flagged "down" → `restore` tries to
`uffs_winsvc::start` it → that ALSO needs elevation → fails → a hard FAIL
(exit 1) for a perfectly running broker.

Two surgical fixes:
- doctor `check_services`: determine the broker's liveness from its serving
  pipe (the authoritative signal, same probe `check_broker` uses), not from
  pid `OpenProcess` liveness. So a serving broker reads as "Service up", never
  enters the down/restart path.
- restore `start_broker`: make it idempotent — if the broker is already
  serving, return success without an elevation-gated `uffs_winsvc::start`.
  This also covers the quiesce→restore path.

Net: a non-elevated repair/restore no longer invents a broker failure when the
broker is up; it only acts (and only warns, never hard-fails non-elevated)
when the pipe is genuinely not serving. Verified: builds + 46 tests green,
clippy clean, windows-msvc cross-compile OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 19, 2026 14:35
@githubrobbi githubrobbi merged commit 5af798b into main Jun 19, 2026
21 checks passed
@githubrobbi githubrobbi deleted the fix/update-repair-false-broker-failure branch June 19, 2026 14:49
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