fix(p3): async file lock for event loop blocking (Issue #763)#772
fix(p3): async file lock for event loop blocking (Issue #763)#772jlin53882 wants to merge 1 commit into
Conversation
d8cdb47 to
da1c2a0
Compare
本地測試結果已套用並測試:
測試結果:
備註: |
Test log (修復前)修復前出現的 error log: Test log (修復後)修復後 log 正常,cleared stale lock 運作但沒有 ENOENT error。 |
a837f1c to
5101089
Compare
rwmjhb
left a comment
There was a problem hiding this comment.
PR #772 Review: fix(p3): async file lock for event loop blocking (Issue #763)
Verdict: CLOSE-LOW-VALUE | Author: jlin53882 | Value: 8% | Short-circuit: hard_floor
Pipeline short-circuited at the value gate after R0 verification — deep review (R2-R6) was skipped.
Problem Statement (R1)
The PR claims to fix event-loop blocking in file-lock handling by replacing synchronous filesystem calls in runWithFileLock with async I/O. The submitted diff instead changes retriever routing and signal propagation, so it does not address the stated file-lock problem.
Close Reasons
- ai_slop — PR #772 body claims "Convert 5 synchronous I/O calls to async versions", but the diff only modifies src/retriever.ts and test/retriever-auto-recall-signal.test.mjs.
- ai_slop — test/retriever-auto-recall-signal.test.mjs describes "PR746 signal extraction + auto-recall BM25 mode" and does not test Issue #763 async file locking.
- speculative_or_premature — src/retriever.ts adds source === "auto-recall" BM25-only routing, while linked Issue #763 describes event-loop blocking in runWithFileLock/store.ts.
Thresholds
| Threshold | Value |
|---|---|
| Value score | 0.08 |
| Hard floor (unconditional close) | < 0.2 |
| Soft threshold (close w/ justification) | < 0.4 |
| Required reasons | 2 |
| Category | hard_floor |
Recommended Action
Close this PR — value is below the review threshold and justification is sufficient.
If the author believes this is wrong, they can request re-review after strengthening the PR description or linking to a maintainer-acknowledged issue.
Reviewed at 2026-05-10T07:30:47Z | R0+R1 gate | Value: codex
P3 修復:runWithFileLock() 的 5 個 sync I/O → async: - existsSync → pathExists() [static async, use access() + constants.F_OK] - mkdirSync → await mkdir() - writeFileSync → await writeFile() - statSync → await stat() - unlinkSync → await unlink() 新增 pathExists() static helper,回傳 Promise<boolean>。 async I/O 不會 block event loop,解決高併發情境下的效能瓶頸。 測試:5/5 通過(pathExists + init + stale check)
P3 乾淨修複已轉至 PR #794感謝維護者的審查回饋。確認問題:PR772 的補丁混入了 retriever.ts 改動(PR746 相關的 BM25 routing + signal),偏離了 Issue #763 的 P3 async file lock 目標。 乾淨版已開: #794 差異
PR794 內容
請重新審查,謝謝。 |
5101089 to
255dcea
Compare
Summary
Issue #763 P3: Event Loop Blocking in runWithFileLock()
Convert 5 synchronous I/O calls to async versions to prevent event loop blocking:
Changes
ode:fs/promises\ imports (access, mkdir, stat, unlink, writeFile)
Tests
\\�ash
node --test test/p3-async-file-lock.test.mjs
6/6 tests passed
\\
Code Review