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 于 1 天前认领。 未关闭
难度 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
-
难度 2/5 1-3 小时 新手友好度 62/100
calcit-lang/caps#16 ·
-
难度 2/5 1-3 小时 新手友好度 85/100
penso/herdr-gpui#934 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
Y-ASLant/ElegantClipboard#178 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
linxiv-dev/linXiv#384 · 1 条评论 ·
维护者通常 1 天内回复
-
priority middle
难度 2/5 1-3 小时 新手友好度 70/100
KATO-Hiro/AtCoderClans#12945 ·
维护者通常 1 天内回复