From e1a9ac04a0eeed7d67fb558830af3a000bd84574 Mon Sep 17 00:00:00 2001 From: khaliqgant Date: Mon, 5 Oct 2026 20:35:43 -0700 Subject: [PATCH] fix(mount): request raw tar on github working-tree seed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tar seed pins gzip=1, which only affects server-GENERATED tars — the retained source archive is served from R2 either way. Generated tars over 128 MiB (gzipped or not) are held to the buffered export ceiling server-side, so the cloud repo's ~174 MiB working tree 413s on the base-snapshot and merged-manifest paths — including the ACL deny fall-through — and the mount drops to ~6k bulk reads that cannot fit the fleet readiness deadline. Request gzip=0: raw tar streams under the multi-GiB ceiling and skips the CompressionStream CPU the buffered ceiling exists to protect. The client already sniffs Content-Type for its gzip reader, so the stored archive path is unaffected. --- internal/mountsync/syncer.go | 10 +++++++++- internal/mountsync/syncer_test.go | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/mountsync/syncer.go b/internal/mountsync/syncer.go index af5f6547..68683508 100644 --- a/internal/mountsync/syncer.go +++ b/internal/mountsync/syncer.go @@ -6784,7 +6784,15 @@ func (s *Syncer) pullRemoteFullGithubTarSeed(ctx context.Context, client githubW PathPrefix: s.githubWorkingTree.ContentsRoot, HeadSHA: headSHA, SourceProfile: manifest.SourceProfile, - Gzip: true, + // Raw tar, not gzip: the flag only affects server-generated + // tars — the retained source archive is served from R2 either + // way. A gzipped generated tar is held to the server's 128 MiB + // buffered ceiling, so any repo past that size 413s on the + // merged/base-snapshot paths (including the ACL deny + // fall-through) and drops to per-file pulls. Raw tar gets the + // multi-GiB streaming ceiling and skips the CompressionStream + // CPU the ceiling exists to protect. + Gzip: false, SourceArchive: true, }) }) diff --git a/internal/mountsync/syncer_test.go b/internal/mountsync/syncer_test.go index b682d8ff..41d098aa 100644 --- a/internal/mountsync/syncer_test.go +++ b/internal/mountsync/syncer_test.go @@ -3107,8 +3107,8 @@ func TestPullRemoteFullGithubWorkingTreeTarSeedsAndStoresCursor(t *testing.T) { if client.lastTarSeed.SourceProfile != "complete-v1" { t.Fatalf("expected complete source profile on tar export, got %q", client.lastTarSeed.SourceProfile) } - if !client.lastTarSeed.SourceArchive || !client.lastTarSeed.Gzip { - t.Fatalf("expected native gzip source archive request, got %+v", client.lastTarSeed) + if !client.lastTarSeed.SourceArchive || client.lastTarSeed.Gzip { + t.Fatalf("expected source archive request with raw (gzip=0) generated tar, got %+v", client.lastTarSeed) } gotReadme, err := os.ReadFile(filepath.Join(localDir, "README.md")) if err != nil {