Default localCacheMode to move-directory; add EXDEV copy fallback - #41
frostebite merged 2 commits into
Conversation
Switches the default local cache mode from tar (archive+extract, copies bytes twice) to move-directory (O(1) atomic rename), matching child-workspace-service's already-proven pattern. tar remains available as an explicit opt-in, e.g. for distributing cache entries via the existing rclone/S3 built-in container hooks. Adds a renameOrCopy fallback in both local-cache-service.ts and child-workspace-service.ts: a cross-volume rename (EXDEV) or permissions failure (EPERM) now degrades to a copy + source cleanup instead of throwing and losing the cache entirely. Previously this was an unhandled failure mode in both services. Updates two existing tests that implicitly relied on tar being the default to explicitly request tar mode, and adds new coverage for the new default and the EXDEV fallback on both restore and save paths. Part of the game-ci/roadmap#11 caching workstream, following on from #40 (canonical-overlay removal). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Follow-up to the earlier canonical-overlay removal commit, now that game-ci/orchestrator#41 has landed switching the default localCacheMode from tar to move-directory: - build-services.mdx: updates the Cache Mode table and Inputs table to show move-directory as default, and notes the new automatic EXDEV copy fallback for cross-volume setups. - caching.mdx: corrects the removal note (previously said tar was still the default) and updates the roadmap#11 follow-up summary to drop the now-completed default-switch item. - Also removes an orphaned cacheSentinelCanary table row left over from the canonical-overlay removal edit, and restores a missing blank line before a heading. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
"local" no longer accurately describes this input now that distributed caching via the rclone/S3 built-in container hooks is a supported (if not-yet-unified, see #42) path. localCacheMode keeps working as a deprecated alias — existing workflows aren't broken, but get a one-time deprecation warning pointing at cacheMode. Internal call sites now read config.cacheMode. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Superseded by #44, which cherry-picks this PR's actual content onto current |
Summary
Stacked on #40 (canonical-overlay removal) — second piece of the game-ci/roadmap#11 caching workstream.
localCacheModefromtartomove-directory.tararchives + extracts (copies bytes twice) on every restore/save;move-directoryis an O(1) atomic rename. This matches the patternchild-workspace-service.tsalready uses successfully.tarremains fully available as an explicit opt-in (localCacheMode: tar) — still the right choice when distributing cache entries via the existing rclone/S3 built-in container hooks, since those push/pull tar archives.EXDEV/EPERM→ copy fallback (renameOrCopyhelper) in bothlocal-cache-service.tsandchild-workspace-service.ts. Previously a cross-volume rename (e.g.localCacheRoot/parentCacheRootmisconfigured on a different volume than the workspace) was an unhandled failure — it threw, and the caller's catch-all just discarded the cache and started fresh. Now it degrades gracefully to a copy + source cleanup (same net effect as a successful rename, just slower).Why
Audit and rationale in game-ci/roadmap#11 (workstream 1). Short version:
tar's double-copy cost is the most expensive path for large Library trees and shouldn't be the silent default;move-directoryalready existed and already worked, it just wasn't chosen automatically. The EXDEV gap was a real correctness issue independent of the default question — worth fixing regardless of which mode is default.Test plan
yarn typecheck— cleanyarn lint— 0 errorsyarn test— 923/924 passing (1 pre-existing, unrelated flaky timeout incli-integration.test.ts, confirmed passing in isolation and untouched by this diff)tarbeing the default to explicitly requesttarmodeRef: game-ci/roadmap#11