Skip to content

Quiet clone prefetch when the shared cache contains completed packs - #2169

Merged
Tyrie Vella (tyrielv) merged 2 commits into
microsoft:masterfrom
tyrielv:tyrielv/quiet-cached-prefetch
Nov 12, 2026
Merged

Tyrie Vella (tyrielv) merged 2 commits into
microsoft:masterfrom
tyrielv:tyrielv/quiet-cached-prefetch

Conversation

@tyrielv

@tyrielv Tyrie Vella (tyrielv) commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem and Context

When gvfs.trust-pack-indexes=false, clone starts commit prefetch in a minimized window and prints the initial-prefetch warning.
This also happens when the shared cache already contains prefetch packs.
The window can appear briefly even when prefetch has no new packs to download.

Changes

  • Reuse the prefetch step's pure timestamp parser to check for a cached pack with a matching index and no incomplete marker.
  • Suppress the announcement and select a hidden window for the cached path. Continue prefetch to check for newer packs.
  • Keep the announcement and minimized window for empty or incomplete caches. Preserve trusted-index prefetch and --no-prefetch behavior.
  • Log cache inspection errors and retain the initial-prefetch behavior if inspection fails. Keep process-start errors visible in clone output.
  • Release the process handle after background prefetch starts, without a wait for the worker.
  • Add mock-based unit tests for cached-pack detection, mixed complete and incomplete packs, window selection, announcements, and error paths.
  • Add functional tests that run clone with cached and empty caches, plus trusted-index and --no-prefetch cases.
    The tests assert the announcement and prefetch requests. The tests wait for prefetch to finish before cleanup.
    The tests use a per-test Git home so native and Git config readers select the same flag.

Known gaps and deliberate decisions

  • Cache hint: The cached-pack check selects presentation only. It does not prove cache freshness or pack integrity.
    A stale or damaged cache can still require a long hidden prefetch.
    Freshness and integrity checks remain outside this change, with no follow-up planned.

Use the prefetch step's pure timestamp parser to find indexed packs
without incomplete markers before clone starts background prefetch.
For cached packs, request a hidden window and omit the announcement.
Continue prefetch to check for updates.

Retain the initial-prefetch window and announcement for empty or incomplete
caches. Preserve trusted-index prefetch and the no-prefetch option.
Log cache inspection failures and preserve process-start errors.
Release the Process wrapper without waiting for the worker.

Add mock-based unit tests for cache detection, mixed complete and incomplete
packs, background launch options, announcements, and error paths.
Add functional tests that run clone with cached and empty caches.
The tests also assert trusted-index and no-prefetch behavior, and wait for
background prefetch to complete before cleanup.
The tests isolate native and Git config reads in a per-test home.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
@KeithIsSleeping

Copy link
Copy Markdown

[KeithBot]: ⚠️ 1 issue · iteration 1 (e17ba9c)

  1. 🟡 Medium Cached-pack FT cases block on inherited console stdin in local runs

Approach: Right layer: clone's launcher picks the hidden window and no notice from a read-only check that matches PrefetchStep's completed-pack rule, and prefetch still runs.

Validation

  • ❌ FT cache seeding with console stdin
  • ✅ GVFS.UnitTests 1759 head vs 1748 base
  • ✅ CloneVerbTests + Maintenance/Prefetch
  • ✅ Real gvfs clone E2E on loopback server
  • ✅ New FT method replayed, 8 flag combos
  • ✅ CI run 43107010256, 34/34 jobs
  • ✅ NativeAOT ILC compile of GVFS.csproj
  • ✅ Hidden vs Minimized console launch
  • ⏭️ Mounted functional suite — not run

🤖 KeithBot · claude-opus-5.5, gpt-6.1-sol, gemini-4-argon + approach review · reply on a thread to dispute

Pass an empty input stream to pack-objects so the cached-pack functional
tests do not inherit console stdin. Dispose the stream after cache setup.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Tyrie Vella <[email protected]>
@KeithIsSleeping

Copy link
Copy Markdown

[KeithBot]: ✅ Resolved · iteration 2 (f54e0b7)

  • Cached-pack FT cases block on inherited console stdin in local runs: fixed
  • New changes since iteration 1: no new issues

Validation

  • ⚠️ CI run 43260918700 (attempt 2) — partial
  • ✅ PR FT cases, console stdin @ f54e0b7
  • ✅ Control: same harness, e17ba9c FT dll
  • ✅ FT + UnitTests Debug build @ f54e0b7

Approving.

🤖 KeithBot · recheck by claude-opus-5.5 · reply on a thread to dispute

@tyrielv
Tyrie Vella (tyrielv) merged commit 62037a2 into microsoft:master Nov 12, 2026
39 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants