Repository navigation
ci(docker-task): clear a dead zccache daemon's state before the task (#3383) - #3384
Merged
Merged
Conversation
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.
Fixes #3383
RED 8c82e33:
ci/test_docker_task_zccache.pyruns the wrapper script against a fake cache dir. It covers a socket that refuses connects (a bound, then closed listener), a missing socket with a stale lock, spawn-failed marker and process record, a live listening socket, and the command's exit status. It also checks thatrun()wraps the command only when--env ZCCACHE_CACHE_DIR=is given. Against unchanged code it fails with 4 errors and 1 failure, becauseZCCACHE_STALE_SCRIPTdoesn't exist.GREEN 07aaa1f: when a task passes
ZCCACHE_CACHE_DIR, docker-task runs the command through a shortshprelude. For eachv*/daemon-*.lock, it tries to connect to the daemon's socket (uv run --no-project --offline python, 1 s timeout). If the socket refuses or is missing, it removes the socket, the lock, the.spawn-failedcool-down marker anddaemon.running-process.json, thenexecs the command. A daemon that still accepts connections, such as another container on the same volume, is left alone. Without uv in the image nothing is removed, because the socket can't be tested. The cache contents are never touched, and the command's exit status is kept.Why: zccache identifies its daemon by pid plus
boot_id. Containers share the host'sboot_idbut each starts a new PID namespace. On a persistent cache volume, the next container finds the old pid taken by another process, decides the daemon "exists but not accepting connections", enters a 60 s cool-down and fails every compile with exit 125.Verified end to end (linux-validate image, persistent
/build/zccache-3383): two consecutivedocker_task.py runcontainers each printdocker-task: cleared stale zccache daemon state in /build/zccache-3383/v1.15.5and compile. Before this change, the second container in the same setup failed withdaemon recovery already failed on this cache root and is in its cool-down(three times in a row on 2026-11-01, while working on #3191).Upstream fix still to file on zccache: identify the daemon by PID-namespace inode plus pid, or by a socket connect.
Tests:
ci/test_docker_task_zccache.py(6 cases, about 1 s) andci/test_docker_task_prune.pypass, and./lintpasses. Python only; no Rust or C tiers apply.