An input edited while a cached task runs is fingerprinted after the run, so the next run replays output built from the old content
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 56/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- rust
- 領域
- build-system, tooling
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Rust
- 星號
- 480
- 分支
- 50
- 平均合併
- 1 天 5 小時
- 30 天內合併 PR
- 63
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
voidzero-dev/vite-task 的其他 Issue
-
難度 5/5 一週以上 新手友好度 35/100
voidzero-dev/vite-task#921 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 56/100
voidzero-dev/vite-task#910 · 1 則留言 ·
維護者通常 1 天內回覆
-
Automatic output tracking misses files a task renames into place, so a cache hit restores nothing未關閉
難度 4/5 3-5 天 新手友好度 48/100
voidzero-dev/vite-task#908 ·
維護者通常 1 天內回覆
-
Export OpenTelemetry client spans for the native remote cache可能已有人在做 @jasonkuhrt 今天認領。 未關閉
難度 4/5 3-5 天 新手友好度 25/100
voidzero-dev/vite-task#906 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 55/100
voidzero-dev/vite-task#904 ·
維護者通常 1 天內回覆
查看 voidzero-dev/vite-task 的全部 Issue
相似的 Issue
-
good first issue help wanted r-docs
難度 2/5 1-3 小時 新手友好度 72/100
servo/rust-smallvec#824 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
priority middle
難度 1/5 1 小時以內 新手友好度 62/100
KATO-Hiro/AtCoderClans#12940 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
hurttlocker/o8#5112 ·