Skip to content

linux-validate: give each checkout its own zccache volume (#2028) - #2033

Merged
zackees merged 2 commits into
masterfrom
fix/2028-tier2-zccache-per-checkout
Oct 24, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/2028-tier2-zccache-per-checkout

Conversation

@zackees

@zackees zackees commented Oct 24, 2026

Copy link
Copy Markdown
Member

Fixes #2028.

The local Tier 2 runner (rust/tools/linux-validate/run.sh) mounted one machine-wide obs-rust-linux-validate-zccache volume into every checkout's container, and each checkout's source at the same /ro. zccache keeps its daemon socket in the cache dir (/zccache/v1.15.5/daemon-v1.15.5.sock), so while one checkout's container had a daemon running, another checkout's compiles went to it and read that container's /ro.

ZCCACHE_DAEMON_NAMESPACE does give a separate socket, but zccache allows one daemon per cache root: a second namespaced daemon on the same volume never starts (daemon recovery already failed on this cache root ... no daemon lockfile observed within 10s). So the volume is now per checkout (--stack-volume, obs-rust-linux-validate-zccache-<id>), the same as the build volume since #135. It keeps its 3G budget. --clean resets it with the build volume, and --clean-all now drops only the crate caches. CI is unaffected: it uses OBS_ZCCACHE_DIR. The cost is a cold compiler cache on a checkout's first run.

Local RED → GREEN (focused CI/tooling fix): two directories with different x.c (v() returns 1 or 2), the Tier 2 image, and container A holding a zccache daemon on a volume:

  • RED, shared volume: container B compiles /ro/x.c through zccache cc. A's daemon writes the object inside A's container, so B's link fails with cannot find x.o: No such file or directory. This is the same symptom as the cc1: fatal error: /ro/test/cmocka/...: No such file seen in real runs.
  • GREEN, per-checkout volumes (this change): B prints v=2 on the first run and on a second, cached run.

In real runs this showed up as stale objects (test_deinterlace_pacing_steps failing with pre-#1995 results that #1995's CI passed) and as missing new test files. ./lint passes.

zccache keeps its daemon socket in the cache dir and allows one daemon per
cache root, so with one machine-wide volume a checkout's container sent its
compiles to another checkout's running daemon, which read that container's
/ro: object files of other source, and 'No such file' for files new to this
checkout. The zccache volume is now a per-checkout stack volume, like the
build volume (#135); --clean resets it, --clean-all drops only the crate
caches. OBS_ZCCACHE_DIR (CI) is unchanged.
test_zccache_is_shared pinned the shared volume this fix removes; the test
now requires a distinct obs-rust-linux-validate-zccache-<id> per checkout
and fails against master's run.sh.
@zackees

zackees commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

Added a regression test: ci/test_tier2_run.py's test_zccache_is_shared pinned the shared volume, so it's now test_zccache_is_per_checkout (two checkouts get different obs-rust-linux-validate-zccache-<id> volumes). It fails against master's run.sh and passes here. ./lint passes.

@zackees
zackees enabled auto-merge October 24, 2026 02:48
@zackees
zackees added this pull request to the merge queue Oct 24, 2026
Merged via the queue into master with commit f5caae0 Oct 24, 2026
31 checks passed
@zackees
zackees deleted the fix/2028-tier2-zccache-per-checkout branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: local Tier 2 can compile another checkout's source through the shared zccache daemon

1 participant