Skip to content

Conversation

@bazel-io
Copy link
Member

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 #28408

Closes #28416.

PiperOrigin-RevId: 862135346
Change-Id: Ic6a0b190be8f4769788078afe481496996f82013

Commit 55e4aac

…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
@bazel-io bazel-io added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Jan 28, 2026
@bazel-io bazel-io requested a review from a team as a code owner January 28, 2026 10:39
@bazel-io bazel-io requested a review from coeuvre January 28, 2026 10:39
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@iancha1992 iancha1992 enabled auto-merge (squash) January 28, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants