An input edited while a cached task runs is fingerprinted after the run, so the next run replays output built from the old content
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- build-system, tooling
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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)
- A
buildtask withcache: trueand automatic input tracking runsnode build.mjs. The script readsinput.txt, printsread: <content>, waits 5 s, then writes the content toout.txt. - With
input.txt=v1, startvp run build. Once it printsread: v1, writev2toinput.txt. The run finishes and writesout.txt=v1. - Run
vp run buildagain. It reportscache hit, 5.17s saved, andout.txtis stillv1whileinput.txtisv2. 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.
- Vorherrschende Sprache
- Rust
- Sterne
- 480
- Forks
- 50
- Ø Merge
- 1 T. 5 Std.
- Gemergte PRs (30 T.)
- 63
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/vite-task
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
voidzero-dev/vite-task#921 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 56/100
voidzero-dev/vite-task#910 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Automatic output tracking misses files a task renames into place, so a cache hit restores nothingOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
voidzero-dev/vite-task#908 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Export OpenTelemetry client spans for the native remote cacheEvtl. vergeben @jasonkuhrt hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
voidzero-dev/vite-task#906 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
voidzero-dev/vite-task#904 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/vite-task
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
compiler P4 perf
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
HerringtonDarkholme/hd-lang#1044 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue help wanted r-docs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
servo/rust-smallvec#824 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
akitaonrails/ai-usagebar#552 ·
Maintainer antworten meist innerhalb von 1 Tag