Skip to content

[9.0.0] Don't keep the journal of a PersistentMap open#28250

Merged
Wyverald merged 1 commit intobazelbuild:release-9.0.0from
bazel-io:cp28108-9.0.0
Jan 12, 2026
Merged

[9.0.0] Don't keep the journal of a PersistentMap open#28250
Wyverald merged 1 commit intobazelbuild:release-9.0.0from
bazel-io:cp28108-9.0.0

Conversation

@bazel-io
Copy link
Copy Markdown
Member

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 #28108.

PiperOrigin-RevId: 855242645
Change-Id: Ic7434139b290c6b0e2061977f747e890c3c5ece6

Commit 2be693e

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
@bazel-io bazel-io requested a review from a team as a code owner January 12, 2026 16:46
@bazel-io bazel-io added team-Performance Issues for Performance teams awaiting-review PR is awaiting review from an assigned reviewer labels Jan 12, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Wyverald Wyverald enabled auto-merge January 12, 2026 16:49
@Wyverald Wyverald added this pull request to the merge queue Jan 12, 2026
Merged via the queue into bazelbuild:release-9.0.0 with commit 956e5e3 Jan 12, 2026
46 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Performance Issues for Performance teams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants