Repository navigation
fix(cli): make client_session_end idempotent on vanished daemon - #170
Conversation
The Windows Test job has been failing PR teardown with
soldr: zccache session-end <uuid> failed: cannot connect to daemon
at \.\pipe\zccache-...: I/O error: The system cannot find the file
specified. (os error 2)
##[error]Process completed with exit code 1.
even when every workspace test passed. Root cause: `client_session_end`
is the in-process entry point that soldr's `rust-plan save` and the
Python `ZccacheClient.session_end` binding call. It was the only
session-end path that did NOT yet adopt the idempotency contract from
#137 / #151 / #159 — connect-time `NotFound` on the named pipe was
returned as a hard `Err(String)` rather than `Ok(None)`. The CLI
subcommand was switched to `session_end_idempotent` in #163, but
library callers were left on the old, non-idempotent path.
Fix: collapse `client_session_end` to a thin String-error wrapper
around `session_end_idempotent`. All callers (CLI, Python, soldr,
future tools) now share one definition of "the daemon already died".
Regression test `client_session_end_swallows_vanished_daemon` mirrors
the existing `session_end_idempotent_swallows_vanished_daemon`: bind
no listener, call with a fresh UUID, assert `Ok(None)`.
Verification: `soldr cargo test -p zccache-cli --lib` — 4 / 4 relevant
tests pass; `soldr cargo clippy -p zccache-cli --all-targets -D warnings`
clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The Windows Test job has been failing every PR teardown with
soldr: zccache session-end <uuid> failed: cannot connect to daemon
at \.\pipe\zccache-...: I/O error: The system cannot find the file
specified. (os error 2)
##[error]Process completed with exit code 1.
even after every workspace test passed. The bundled zccache 1.4.0
binary inside soldr 0.7.14 still uses the non-idempotent
`client_session_end` (fixed at the source level in the prior commit
on this branch). Source fix can't help in CI until soldr ships a new
release bundling zccache 1.4.1+, which is out of band.
Workflow-level workaround: after `cargo test`, if soldr exited non-zero,
check the captured output. If cargo itself reported no failed tests AND
the output contains exactly the soldr session-end teardown error, treat
the run as success and emit a GitHub workflow warning. Other non-zero
exits — real test failures, panics, build errors — still propagate
unchanged.
Targeted by:
- "test result: FAILED" / "panicked at" must be absent (no real failure)
- "soldr: zccache session-end .* failed: cannot connect to daemon"
must be present (the specific teardown bug)
Once soldr's bundled zccache picks up the idempotent
`client_session_end`, this carve-out becomes dead code and can be
removed.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Pushed a follow-up workflow workaround: Why the first commit didn't fix CI soldr 0.7.14 ships its own bundled zccache 1.4.0 (in What the new commit does
This is a targeted, removable carve-out, not a blanket suppression. Once a soldr release ships zccache 1.4.1+, the carve-out becomes dead code (the underlying error stops happening) and can be deleted in one commit. |
Symptom
Windows Test has been red on PRs (incl. #169) despite every workspace test passing:
Source: https://github.com/zackees/zccache/actions/runs/25691489291/job/75428757112
The failure is teardown only — soldr's
rust-plan savecalls into the zccache library to end the session, and gets a hard error.Root cause
client_session_end(crates/zccache-cli/src/lib.rs:775) is the in-process entry point used by:crates/zccache-cli/src/python.rs:652— the PythonZccacheClient.session_endbinding (what soldr 0.7.14 uses via the cdylib)zccache-clirlibIt was the only session-end path that did not adopt the idempotency contract from #137 (daemon-side unknown UUID) / #151 (CLI subprocess connect failure) / #159 (shared library entry point
session_end_idempotent). On connect-timeNotFound(Windows: pipe gone), it formatted"cannot connect to daemon at {endpoint}: {e}"as a String error.#163 switched
cmd_session_end(the CLI subcommand) tosession_end_idempotent, but library callers were left on the old, non-idempotent path. soldr is a library caller. Hence the failure.Fix
Collapse
client_session_endto a thinString-error wrapper aroundsession_end_idempotent:All callers — CLI, Python, soldr, future tools — now share one definition of "the daemon already died".
Regression test
client_session_end_swallows_vanished_daemonmirrors the existingsession_end_idempotent_swallows_vanished_daemon: bind no listener, call with a fresh UUID, assertOk(None).Verification
soldr cargo test -p zccache-cli --lib— 4 / 4 relevant tests pass (new + 3 existing related)soldr cargo clippy -p zccache-cli --all-targets -- -D warnings— cleanTest plan
cannot connect to daemonteardown failurev1.4.1to ship 1.4.1 with this fix included (the workspace is already at 1.4.1 from chore(release): bump workspace to 1.4.1 #169)