[9.0.1] Fix a deadlock in RemotePathChecker when using a disk cache (https://github.com/bazelbuild/bazel/pull/28416)#28465
Merged
iancha1992 merged 1 commit intobazelbuild:release-9.0.1from Feb 2, 2026
Conversation
…uild#28416) The call to `RemoteActionFileSystem#getInputStream` in `RemotePathChecker#isRemote` could result in a deadlock since it is executed on the same executor that is also used to prefetch the file from the disk cache. This is fixed by replacing the blocking call with a future. Along the way the method is renamed to avoid confusion due to two different meanings of "remote" (not being available in the disk cache vs. not being materialized at the exec path). Fixing this bug makes it possible to run all BwoB tests with disk cache. Related to bazelbuild#28408 Closes bazelbuild#28416. PiperOrigin-RevId: 862135346 Change-Id: Ic6a0b190be8f4769788078afe481496996f82013
There was a problem hiding this comment.
Code Review
This pull request fixes a potential deadlock in RemotePathChecker when a disk cache is used. The deadlock occurred because of a cyclic dependency in synchronous calls. The fix refactors the logic to use ListenableFuture to break the cycle, making the check for local availability of a file asynchronous. The method isRemote in RemotePathChecker has been aptly renamed to isAvailableLocally for better clarity. Additionally, integration tests have been parameterized to run with a disk cache, which will help prevent future regressions. The changes are well-implemented and correctly address the issue.
meteorcloudy
approved these changes
Feb 2, 2026
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
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 call to
RemoteActionFileSystem#getInputStreaminRemotePathChecker#isRemotecould result in a deadlock since it is executed on the same executor that is also used to prefetch the file from the disk cache.This is fixed by replacing the blocking call with a future. Along the way the method is renamed to avoid confusion due to two different meanings of "remote" (not being available in the disk cache vs. not being materialized at the exec path).
Fixing this bug makes it possible to run all BwoB tests with disk cache.
Related to #28408
Closes #28416.
PiperOrigin-RevId: 862135346
Change-Id: Ic6a0b190be8f4769788078afe481496996f82013
Commit 55e4aac