[8.6.0] Fix disk cache failures on concurrent read-write access on Windows (h…#28529
[8.6.0] Fix disk cache failures on concurrent read-write access on Windows (h…#28529iancha1992 merged 4 commits intobazelbuild:release-8.6.0from
Conversation
…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
There was a problem hiding this comment.
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 Add an |
### 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)
### 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)
### 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]>
…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