Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉
#905 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
56/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
rust

研究方向

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)

  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.

主要語言
Rust
星號
480
分支
50
平均合併
1 天 5 小時
30 天內合併 PR
63

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

voidzero-dev/vite-task 的其他 Issue

查看 voidzero-dev/vite-task 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。