[9.0.0] Don't keep the journal of a PersistentMap open#28250
Merged
Wyverald merged 1 commit intobazelbuild:release-9.0.0from Jan 12, 2026
Merged
[9.0.0] Don't keep the journal of a PersistentMap open#28250Wyverald merged 1 commit intobazelbuild:release-9.0.0from
Wyverald merged 1 commit intobazelbuild:release-9.0.0from
Conversation
This ensures that the journal file is not kept open after a build, which has been observed to cause `RewindingTest` to fail on Windows, which disallows deleting open files (in this case during test case cleanup). Since the journal is written out at most every 3 seconds for all current usages of the `PersistentMap` class, the overhead of the additional `open` is negligible. Also include small tweaks to `RewindingTest` so that it can be enabled on Windows. In particular, the order of `SymlinkAction` and `SourceManifestAction` being rewound doesn't seem to be fixed and can differ on Windows. Closes bazelbuild#28108. PiperOrigin-RevId: 855242645 Change-Id: Ic7434139b290c6b0e2061977f747e890c3c5ece6
justinhorvitz
approved these changes
Jan 12, 2026
There was a problem hiding this comment.
Code Review
This pull request addresses an issue with PersistentMap on Windows by ensuring the journal file is not kept open. The change to use a try-with-resources block for the journal writer in flushJournal is a clean and effective solution. Additionally, the modifications to RewindingTest and RewindingTestsHelper to enable the test on Windows and make it more robust against platform-specific action ordering are well-implemented. The refactoring in the test helper also improves code clarity. Overall, the changes are solid and I have no major concerns.
Merged
via the queue into
bazelbuild:release-9.0.0
with commit Jan 12, 2026
956e5e3
46 checks passed
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.
This ensures that the journal file is not kept open after a build, which has been observed to cause
RewindingTestto fail on Windows, which disallows deleting open files (in this case during test case cleanup).Since the journal is written out at most every 3 seconds for all current usages of the
PersistentMapclass, the overhead of the additionalopenis negligible.Also include small tweaks to
RewindingTestso that it can be enabled on Windows. In particular, the order ofSymlinkActionandSourceManifestActionbeing rewound doesn't seem to be fixed and can differ on Windows.Closes #28108.
PiperOrigin-RevId: 855242645
Change-Id: Ic7434139b290c6b0e2061977f747e890c3c5ece6
Commit 2be693e