Skip to content
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

[7.2.0] Remove unnecessary synchronization on RepositoryCache #21788

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

bazel-io
Copy link
Member

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

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
@bazel-io bazel-io requested a review from a team as a code owner March 25, 2024 18:22
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Mar 25, 2024
@bazel-io bazel-io requested a review from Wyverald March 25, 2024 18:22
@iancha1992 iancha1992 enabled auto-merge (squash) March 25, 2024 18:29
@iancha1992 iancha1992 merged commit 0fadb73 into bazelbuild:release-7.2.0 Mar 28, 2024
32 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants