-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary synchronization on RepositoryCache
#21403
Closed
Closed
Conversation
This file contains 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
With a single exception that didn't matter for correctness, the operations on `RepositoryCache` were already atomic on the level of the file system and thus don't require `synchronized`. In fact, since different Bazel server instances share the same repository cache concurrently, this already had to be the case. Also removes unnecessary interrupt checks and method overloads only used in tests.
@Wyverald Friendly ping in case you forgot about it, no-op ping in case you are busy :-) |
Wyverald
reviewed
Mar 8, 2024
src/main/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCache.java
Show resolved
Hide resolved
sorry about the delay, I had indeed forgotten. The PR overall LGTM, just asked for a small clarification. |
Wyverald
approved these changes
Mar 8, 2024
@bazel-io fork 7.2.0 |
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Mar 25, 2024
With a single exception that didn't matter for correctness, the operations on `RepositoryCache` were already atomic on the level of the file system and thus don't require `synchronized`. In fact, since different Bazel server instances share the same repository cache concurrently, this already had to be the case. The exception was a file write that stores the canonical id in a file whose name contains a hash of the id. However, the content of this file is never read, only its existence matters. The write is replaced by a touch. Also removes unnecessary interrupt checks and method overloads only used in tests. Work towards bazelbuild#20369 Closes bazelbuild#21403. PiperOrigin-RevId: 614728666 Change-Id: I67f81bd9e468260e4f83f15d6aaafa57e34d18f4
iancha1992
pushed a commit
that referenced
this pull request
Mar 28, 2024
With a single exception that didn't matter for correctness, the operations on `RepositoryCache` were already atomic on the level of the file system and thus don't require `synchronized`. In fact, since different Bazel server instances share the same repository cache concurrently, this already had to be the case. The exception was a file write that stores the canonical id in a file whose name contains a hash of the id. However, the content of this file is never read, only its existence matters. The write is replaced by a touch. Also removes unnecessary interrupt checks and method overloads only used in tests. Work towards #20369 Closes #21403. PiperOrigin-RevId: 614728666 Change-Id: I67f81bd9e468260e4f83f15d6aaafa57e34d18f4 Commit 8eade04 Co-authored-by: Fabian Meumertzheim <[email protected]>
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.
With a single exception that didn't matter for correctness, the operations on
RepositoryCache
were already atomic on the level of the file system and thus don't requiresynchronized
. In fact, since different Bazel server instances share the same repository cache concurrently, this already had to be the case.The exception was a file write that stores the canonical id in a file whose name contains a hash of the id. However, the content of this file is never read, only its existence matters. The write is replaced by a touch.
Also removes unnecessary interrupt checks and method overloads only used in tests.
Work towards #20369