Repository navigation
Conversation
The daemon is stopped before its upload queue drains, so a large path can be logged as pushed and still be missing from the cache. Store-scan mode already ends with a diff-and-push; do the same in daemon mode once the daemon is gone, where cachix push skips the paths that are already there. The daemon stop moves into stopDaemon() so the sweep also runs when the daemon never started.
sandydoo
reviewed
Oct 23, 2026
sandydoo
left a comment
Member
There was a problem hiding this comment.
This is undesirable for several reasons, particularly in cases where the store is persisted between runs.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
cachix daemon stopreturns before the daemon's upload queue drains, so a large path can be reported asPushing …in the post step, the job can go green, and the path can still be missing from the cache. Every job involved looks successful; the loss only shows up later as a cache miss. #221 has the evidence: a 4.07 GiBdockerTools.buildImagetarball loggedPushingat 23:51:04, the daemon was stopped at 23:51:17, and itsnarinfoanswered 404 on both caches, while a small path from the same post step answered 200.The CLI-level fix — draining the queue before
daemon stopreturns, or reporting what could not be pushed — is still the better one. This change makes the action correct regardless.What
push-paths.shdiff.cachix pushskips paths already in the cache (narinfoExists→onAlreadyPresentinCachix/Client/Push.hs), so this uploads only what the daemon dropped and costs one HEAD per new path when nothing was lost.stopDaemon(), so the sweep also runs when the daemon never started or has no pid — cases that previously ended the push with nothing landed.pushNewPaths()andrecordPreBuildPaths(), which removes the duplicated block from the switch.Verification
pnpm buildbundles the patch intodist/index.js. Same harness for both bundles, only the bundle differs: the post step runs withSTATE_pushMode=Daemonand no daemon directory, a stubcachixrecords its calls, the listing before the build holds/nix/store/old, and the listing after it holds/nix/store/oldand/nix/store/built.Both runs log
::error::Cachix Daemon not started. Skipping pushfirst; only the patched bundle reaches the sweep. The action's own fixture (nix-build tests) covers the daemon path end to end in CI.References
Pushing