Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

An input edited while a cached task runs is fingerprinted after the run, so the next run replays output built from the old content

Aperta
#905 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start in crates/vt/src/session/execute/fingerprint.rs at PostRunFingerprint::create and trace how tracked reads are fingerprinted after a task exits. Use the reproduction linked in the issue (bash repro.sh) to observe the stale cache hit, then verify that an input edited during a run prevents that run from being stored and the next run executes with the new content.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

If a cached task's input is edited after the task has read it but before the task exits, the next run is a cache hit that replays output built from the old content. The input is fingerprinted when the run ends, so the cache entry pairs the new content's hash with output built from the old content.

The hashing happens in PostRunFingerprint::create (crates/vt/src/session/execute/fingerprint.rs), which calls fingerprint_path on each tracked read once the task has exited. vite-plus#39 described this race and was closed in March, but it reproduces on vite-plus 1.4.0 (vite-task 40cb9ca).

Repro with vite-plus 1.4.0, Node 24.18.1, pnpm 12.16.1 on macOS: https://gist.github.com/birbprophet/2fa1f32a846c2cd1cc251175fdb6d45d (git clone it, then bash repro.sh)

  1. A build task with cache: true and automatic input tracking runs node build.mjs. The script reads input.txt, prints read: <content>, waits 5 s, then writes the content to out.txt.
  2. With input.txt = v1, start vp run build. Once it prints read: v1, write v2 to input.txt. The run finishes and writes out.txt = v1.
  3. Run vp run build again. It reports cache hit, 5.17s saved, and out.txt is still v1 while input.txt is v2. Every later run hits the same entry until the input changes again.

Expected: the second run misses with 'input.txt' modified and writes v2.

We hit this with a 90 s message compile. A key added during the compile was missing from the output, and every later run replayed that output from the cache.

A fix could hash each input when it's read, or keep the post-run hash but also hash (or stat) inputs as they are read and refuse to store the entry when the two disagree. Either way the edited run should not be stored, so the next run re-executes.

Lingua principale
Rust
Stelle
480
Fork
50
Merge medio
1g 5h
PR unite (30g)
63

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/vite-task

Tutte le issue di voidzero-dev/vite-task

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.