From 171c73e511881aaf4d3650408bffa7580756a876 Mon Sep 17 00:00:00 2001 From: serrrfirat Date: Mon, 22 Jun 2026 00:45:28 +0300 Subject: [PATCH] ci(reborn): share one Rust cache across the closure instead of ~60 per-crate caches The closure's crate-tests matrix used a per-crate cache key (`reborn-tests-`), producing ~60 caches that each bundle the cargo registry + a target dir (~0.4-0.7 GB each), plus 4 per-partition root caches (~1 GB each). That's ~30+ GB competing for GitHub's ~10 GB per-repo cache LRU, so the caches evict each other almost as fast as they're written: a live snapshot showed only 10 of 64 crates had a cache present, summing to 18 GB and actively evicting. The result is "No cache found" on most jobs -> the crates.io registry is re-downloaded from cold every run, and 64 parallel cold downloads amplify transient registry flakes (the SSL_ERROR_SYSCALL / HTTP2 reds we saw). Switch both matrices to `shared-key`: - crate-tests -> `shared-key: reborn-tests-crates` (one entry for all crate jobs; the registry + shared-dep build is downloaded/compiled once and resident, not ~60x). - root partitions -> `shared-key: reborn-tests-root` (all 4 partitions compile the identical root build, so one cache is strictly better than 4 copies). This drops the reborn-tests cache footprint from ~30+ GB / 68 entries to ~2 entries that comfortably fit the LRU, so the registry stays resident and stops being re-downloaded. Complements CARGO_NET_RETRY (#5115), which remains the safety net for the now-rare cold download. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/reborn-tests.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reborn-tests.yml b/.github/workflows/reborn-tests.yml index 99db88014ca..9296359d256 100644 --- a/.github/workflows/reborn-tests.yml +++ b/.github/workflows/reborn-tests.yml @@ -203,7 +203,15 @@ jobs: - name: Restore Rust cache uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: - key: reborn-tests-${{ matrix.package }} + # ONE shared cache for all ~60 crate-test jobs instead of a per-crate + # key. Per-crate keys produced ~60 caches (registry + target each, + # ~0.4-0.7 GB), which blew far past GitHub's ~10 GB repo cache LRU and + # evicted each other — so most jobs hit "No cache found", re-downloaded + # the crates.io registry from cold, and were exposed to transient + # download flakes (mitigated separately by CARGO_NET_RETRY). A single + # shared key keeps the registry + shared-dep build in one small, + # always-resident entry, so the registry is downloaded once, not ~60x. + shared-key: reborn-tests-crates # Keep saves to protected-branch and merge_group runs so the ~10 GB # repo cache LRU is seeded by shared states, not arbitrary PR branches. save-if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'merge_group' }} @@ -285,7 +293,12 @@ jobs: - name: Restore Rust cache uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: - key: reborn-tests-root-${{ matrix.partition }} + # All 4 root partitions compile the *same* root-package build (they + # only run different test partitions), so one shared cache is strictly + # better than 4 per-partition copies (~1 GB each) — the cached target + # is fully valid for every partition, and it stops the 4 copies from + # crowding the shared LRU. + shared-key: reborn-tests-root # Keep saves to protected-branch and merge_group runs so the ~10 GB # repo cache LRU is seeded by shared states, not arbitrary PR branches. save-if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'merge_group' }}