[7.2.0] Remove unnecessary synchronization on RepositoryCache
#21788
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
Closes #21403.
PiperOrigin-RevId: 614728666
Change-Id: I67f81bd9e468260e4f83f15d6aaafa57e34d18f4
Commit 8eade04