-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[8.4.1] Speculative fix for repo contents cache race #26950
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
Merged
Merged
Conversation
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
The error message observed in bazelbuild#26713 is consistent with `FileChannel#open` failing because the given path doesn't exist. This could happen if one Bazel process observed that `!entryDir.isDirectory()`, which is true if the path doesn't exist, and proceeded to delete the path while another process had just created the directory and is now opening the channel. Since the entry dir is never expected to be an existing non-directory unless the cache has been corrupted, this logic can be removed. Another possible source of `IOException` during normal operation is on an interrupt (such as the user hitting Ctrl+C). Instead, follow Skyframe best practices by surfacing this as an `InterruptedException` instead of a `FileLockInterruptionException`. Also document that concurrent use on the same path is not supported (it results in an `OverlappingFileLockException` if the lock is already held, regardless of whether that is in shared or exclusive mode) and why the current usages are safe. Fixes bazelbuild#26713 Closes bazelbuild#26914. PiperOrigin-RevId: 805338728 Change-Id: Ie808ebe6113b935180b93c21679d5398aa168802
Wyverald
approved these changes
Sep 10, 2025
Merged
via the queue into
bazelbuild:release-8.4.1
with commit Sep 10, 2025
8c1ff19
47 checks passed
dd-mergequeue bot
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Nov 25, 2025
### Motivation See: - https://github.com/bazelbuild/bazel/releases/tag/8.4.0 - https://github.com/bazelbuild/bazel/releases/tag/8.4.1 - https://github.com/bazelbuild/bazel/releases/tag/8.4.2 (8.5.0 is due soon) #### Cache & reliability - 8.4.0 honors XDG_CACHE_HOME on macOS, which will definitely help ([ABLD-300](https://datadoghq.atlassian.net/browse/ABLD-300)): bazelbuild/bazel#26773 - 8.4.1 fixes a race condition affecting repository contents cache: bazelbuild/bazel#26950 - 8.4.0 fixes another race condition affecting workers: bazelbuild/bazel#26475 #### Modules - 8.4.0 brings new `--module_mirrors` flag for fallback URLs when primary sources are slow/unavailable: bazelbuild/bazel#26850 - 8.4.0 avoids the need for dummy `MODULE.bazel` files with `git_repository`/`http_archive`: bazelbuild/bazel#26462 - 8.4.2 fixes a maintenance annoyance for `MODULE.bazel.lock` file: bazelbuild/bazel#27111 #### Platforms - 8.4.0 allows to mitigate the long path issue with **MSVC on Windows**: bazelbuild/bazel#26532 - 8.4.2 fixes **macOS** compatibility issues: bazelbuild/bazel#27014 [ABLD-300]: https://datadoghq.atlassian.net/browse/ABLD-300?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: regis.desgroppes <[email protected]>
chouquette
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Nov 27, 2025
### Motivation See: - https://github.com/bazelbuild/bazel/releases/tag/8.4.0 - https://github.com/bazelbuild/bazel/releases/tag/8.4.1 - https://github.com/bazelbuild/bazel/releases/tag/8.4.2 (8.5.0 is due soon) #### Cache & reliability - 8.4.0 honors XDG_CACHE_HOME on macOS, which will definitely help ([ABLD-300](https://datadoghq.atlassian.net/browse/ABLD-300)): bazelbuild/bazel#26773 - 8.4.1 fixes a race condition affecting repository contents cache: bazelbuild/bazel#26950 - 8.4.0 fixes another race condition affecting workers: bazelbuild/bazel#26475 #### Modules - 8.4.0 brings new `--module_mirrors` flag for fallback URLs when primary sources are slow/unavailable: bazelbuild/bazel#26850 - 8.4.0 avoids the need for dummy `MODULE.bazel` files with `git_repository`/`http_archive`: bazelbuild/bazel#26462 - 8.4.2 fixes a maintenance annoyance for `MODULE.bazel.lock` file: bazelbuild/bazel#27111 #### Platforms - 8.4.0 allows to mitigate the long path issue with **MSVC on Windows**: bazelbuild/bazel#26532 - 8.4.2 fixes **macOS** compatibility issues: bazelbuild/bazel#27014 [ABLD-300]: https://datadoghq.atlassian.net/browse/ABLD-300?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: regis.desgroppes <[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.
The error message observed in #26713 is consistent with
FileChannel#openfailing because the given path doesn't exist. This could happen if one Bazel process observed that!entryDir.isDirectory(), which is true if the path doesn't exist, and proceeded to delete the path while another process had just created the directory and is now opening the channel. Since the entry dir is never expected to be an existing non-directory unless the cache has been corrupted, this logic can be removed.Another possible source of
IOExceptionduring normal operation is on an interrupt (such as the user hitting Ctrl+C). Instead, follow Skyframe best practices by surfacing this as anInterruptedExceptioninstead of aFileLockInterruptionException.Also document that concurrent use on the same path is not supported (it results in an
OverlappingFileLockExceptionif the lock is already held, regardless of whether that is in shared or exclusive mode) and why the current usages are safe.Fixes #26713
Closes #26914.
PiperOrigin-RevId: 805338728
Change-Id: Ie808ebe6113b935180b93c21679d5398aa168802
Commit ca1cbfe