Skip to content

[8.6.0] Fix disk cache failures on concurrent read-write access on Windows (h…#28529

Merged
iancha1992 merged 4 commits intobazelbuild:release-8.6.0from
iancha1992:cp28456
Feb 7, 2026
Merged

[8.6.0] Fix disk cache failures on concurrent read-write access on Windows (h…#28529
iancha1992 merged 4 commits intobazelbuild:release-8.6.0from
iancha1992:cp28456

Conversation

@iancha1992
Copy link
Member

…ttps://github.com//pull/28417)

This applies the fix made to the download cache in 753dc97 to the disk cache.

Work towards #28408

Closes #28417.

PiperOrigin-RevId: 864861790
Change-Id: I6850fc27f3336f44f8d366daac63e4822cb94f73

Commit 73c8da8

…azelbuild#28417)

This applies the fix made to the download cache in 753dc97 to the disk cache.

Work towards bazelbuild#28408

Closes bazelbuild#28417.

PiperOrigin-RevId: 864861790
Change-Id: I6850fc27f3336f44f8d366daac63e4822cb94f73
@iancha1992 iancha1992 requested a review from coeuvre February 4, 2026 23:52
@iancha1992 iancha1992 requested a review from a team as a code owner February 4, 2026 23:52
@iancha1992 iancha1992 added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Feb 4, 2026
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 concurrency issue on Windows with disk cache access by applying a fix that was previously implemented for the download cache. The core change is the introduction of a new utility method, FileSystemUtils.renameToleratingConcurrentCreation, which handles a race condition during file renames on Windows. This new method is then used in both DownloadCache and DiskCacheClient. The changes also include new unit and concurrency tests to validate the fix.

My main feedback is on the implementation of renameToleratingConcurrentCreation, where I've suggested making the fix more general to avoid potential regressions on non-Windows systems that might have similar file locking behavior.

@iancha1992 iancha1992 enabled auto-merge February 4, 2026 23:56
@iancha1992
Copy link
Member Author

@fmeum @coeuvre Could you please suggest a fix?

@iancha1992 iancha1992 requested a review from tjgq February 5, 2026 21:44
@tjgq
Copy link
Contributor

tjgq commented Feb 5, 2026

@iancha1992 Add an import com.google.devtools.build.lib.util.OS to src/test/java/com/google/devtools/build/lib/vfs/FileSystemUtilsTest.java and a corresponding BUILD dependency on //src/main/java/com/google/devtools/build/lib/util:os to the FileSystemTest_lib target in src/test/java/com/google/devtools/build/lib/vfs/BUILD.

@iancha1992 iancha1992 added this pull request to the merge queue Feb 7, 2026
Merged via the queue into bazelbuild:release-8.6.0 with commit 3e37b0a Feb 7, 2026
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Feb 7, 2026
rdesgroppes added a commit to DataDog/datadog-agent that referenced this pull request Feb 27, 2026
### What does this PR do?
Bump `.bazelversion` from 8.5.1 to 8.6.0.

### Motivation
Selected changes between 8.5.1 and 8.6.0:
- Fix visibility for implicit deps of parent rules (bazelbuild/bazel#28722)
- Force rctx.{download_and,}extract to create user-readable files (bazelbuild/bazel#28551)
- Fix disk cache failures on concurrent read-write access on Windows (bazelbuild/bazel#28529)
- Add a target_type argument to ctx.actions.symlink (bazelbuild/bazel#28538)
- Compensate for Windows filesystems lacking junction support (bazelbuild/bazel#28367)
  (our fix)
- Add short_uncached and detailed_uncached options to --test_summary (bazelbuild/bazel#28343)
- Add --experimental_strict_repo_env option (bazelbuild/bazel#28189)
- Make overlaid files executable in http_archive (bazelbuild/bazel#28277)
- Add bazel mod show_repo --all_repos and --all_visible_repos (bazelbuild/bazel#28012)
- Enable --experimental_retain_test_configuration_across_testonly (bazelbuild/bazel#28115)
- Add option to continue with local execution if remote cache is unavailable (bazelbuild/bazel#28001)
rdesgroppes added a commit to DataDog/datadog-agent that referenced this pull request Feb 27, 2026
### What does this PR do?
Bump `.bazelversion` from 8.5.1 to 8.6.0.

### Motivation
Selected changes between 8.5.1 and 8.6.0:
- Fix visibility for implicit deps of parent rules (bazelbuild/bazel#28722)
- Force rctx.{download_and,}extract to create user-readable files (bazelbuild/bazel#28551)
- Fix disk cache failures on concurrent read-write access on Windows (bazelbuild/bazel#28529)
- Add a target_type argument to ctx.actions.symlink (bazelbuild/bazel#28538)
- Compensate for Windows filesystems lacking junction support (bazelbuild/bazel#28367)
  (our fix)
- Add short_uncached and detailed_uncached options to --test_summary (bazelbuild/bazel#28343)
- Add --experimental_strict_repo_env option (bazelbuild/bazel#28189)
- Make overlaid files executable in http_archive (bazelbuild/bazel#28277)
- Add bazel mod show_repo --all_repos and --all_visible_repos (bazelbuild/bazel#28012)
- Enable --experimental_retain_test_configuration_across_testonly (bazelbuild/bazel#28115)
- Add option to continue with local execution if remote cache is unavailable (bazelbuild/bazel#28001)
gh-worker-dd-mergequeue-cf854d bot pushed a commit to DataDog/datadog-agent that referenced this pull request Feb 27, 2026
### What does this PR do?
Bump `bazel` version from 8.5.1 to 8.6.0 to benefit from a series of improvements and fixes.
Ours (bazelbuild/bazel#28367) allows to re-enable "convenience symlinks" for Windows users and makes [`path.realpath`](https://bazel.build/rules/lib/builtins/path#realpath) succeed when sharing a folder between a Linux host and a Windows VM.

### Motivation
Selected changes between 8.5.1 and 8.6.0:
- 💡 bazelbuild/bazel#28001
- bazelbuild/bazel#28012
- 💡 bazelbuild/bazel#28189
- bazelbuild/bazel#28277
- bazelbuild/bazel#28343
- 🐕 bazelbuild/bazel#28367
- bazelbuild/bazel#28529
- bazelbuild/bazel#28538
- bazelbuild/bazel#28551
- bazelbuild/bazel#28722

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

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants