Repository navigation
Parser: wait out a brief lock when opening a V8 log - #9
Merged
Merged
Conversation
The version PR's Windows lane failed with the diagnostic #8 added: "could not analyze …\v8-7560.log: EBUSY: resource busy or locked, open". The worker had already exited (the teardown did not report it as still running), but another process held the file for a moment after its writer closed it, which on Windows is usually an antivirus scan. The test after it reads the same log later and succeeds. readLog now opens through openLog, which retries EBUSY with a backoff (25 ms doubling to 1 s) for up to 10 s and fails at once on any other error. Every reader goes through it: the bench teardown, profile_run, load_log and deoptkit ci, which all read a log right after its writer exits. This also corrects #8's claim that unfinished logs dropped the findings on Windows: the failure on record is this lock. The comment and pending bump file no longer say so.
|
The changes in this PR will be included in the next version bump.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes the flaky Windows lane on the version PR (#5).
The diagnostic #8 added to "the teardown writes findings.json that the LSP can publish" caught the cause on the version PR's Node latest / Windows lane:
The worker had already exited: the teardown did not report it as still running. Another process held the file for a moment after its writer closed it, which on Windows is usually an antivirus scan, and Node reports that sharing violation as
EBUSY. The next test reads the same log later and succeeds.readLognow opens throughopenLog, which retriesEBUSYwith a backoff (25 ms doubling to 1 s) for up to 10 s and fails at once on any other error. Every log reader goes through it: the bench teardown,profile_run,load_loganddeoptkit ci, which all read a log right after its writer exits. So this fixes the same failure for users, not only in CI.A correction to #8. I said there that unfinished logs dropped these findings on Windows. The one failure on record is this lock, so the comment and the pending bump file no longer claim it. The wait for workers to exit stays: V8 does write the end of a log at exit, and Vitest does run the teardown first.
Tests
src/parser/__tests__/logReader.spec.ts, mutation-checked:ENOENT) fails at once; a lock that never clears ends the wait.FileShare.None, as a scanner does) for 700 ms whilereadLogreads it.EBUSY), retry every error, no deadline,readLogbypassing the retry.vp checkis clean, andvp run testpasses 198 tests in 27 files on Node 26.13 (Windows).