Fix async file operations in validator - #34062
Open
luojiyin1987 wants to merge 1 commit into
Open
Conversation
luojiyin1987
marked this pull request as ready for review
August 11, 2026 15:57
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 #34061.
Summary
The validator now waits for each partial result write.
It waits for both final result writes in parallel.
It removes the partial result only after all writes finish.
The removal uses the force option.
Root cause
The writeFile helper added each write after an earlier await.
Promise.all could inspect writeOps before those writes entered the array.
The partial file removal also ran without await.
Impact
The validator now completes all output writes before it exits.
A missing partial result file no longer causes ENOENT.
Pending writes cannot recreate the partial file after cleanup.
The output paths and formats stay unchanged.
Checks
The lifecycle test uses a temporary directory.
It disables external DNS queries in the ignored build copy.