这是indexloc提供的服务,不要输入任何密码
Skip to content

[8.3.1] Fix hang with force fetching + repo contents cache #26412

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 2 commits into from
Jun 26, 2025

Conversation

bazel-io
Copy link
Member

With the repo contents cache enabled, bazel fetch --force (and the now-removed bazel sync) would cause Bazel to hang forever. The reason is that writing into the repo contents cache causes a Skyframe restart very late into RepositoryDelegatorFunction, and the force-fetch bit causes the restarted function to consider it a cache miss, writing into the repo contents cache again, causing an infinite loop.

This PR changes it so that a restarted RepositoryDelegatorFunction will remember whether it had just finished a fetch before; if so, it will use the cache, even if force-fetch is on.

Fixes #26389.

Closes #26409.

PiperOrigin-RevId: 776306095
Change-Id: I52ad7aeb6581a16268d26a8b142041dc0e748768

Commit bf67251

With the repo contents cache enabled, `bazel fetch --force` (and the now-removed `bazel sync`) would cause Bazel to hang forever. The reason is that writing into the repo contents cache causes a Skyframe restart very late into `RepositoryDelegatorFunction`, and the force-fetch bit causes the restarted function to consider it a cache miss, writing into the repo contents cache again, causing an infinite loop.

This PR changes it so that a restarted `RepositoryDelegatorFunction` will remember whether it had _just_ finished a fetch before; if so, it will use the cache, even if force-fetch is on.

Fixes bazelbuild#26389.

Closes bazelbuild#26409.

PiperOrigin-RevId: 776306095
Change-Id: I52ad7aeb6581a16268d26a8b142041dc0e748768
@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 Jun 26, 2025
@bazel-io bazel-io requested a review from a team as a code owner June 26, 2025 22:36
@Wyverald Wyverald enabled auto-merge (squash) June 26, 2025 22:40
@Wyverald Wyverald disabled auto-merge June 26, 2025 23:31
@Wyverald Wyverald merged commit 49e43bb into bazelbuild:release-8.3.1 Jun 26, 2025
44 of 46 checks passed
@Wyverald Wyverald deleted the cp26389-8.3.1 branch June 26, 2025 23:31
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jun 26, 2025
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.

2 participants