Skip to content
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

[7.6.0] Actually fix setting the mtime on a shared disk cache. #25473

Merged

Conversation

bazel-io
Copy link
Member

@bazel-io bazel-io commented Mar 4, 2025

The earlier attempt in e9a18ce was not the correct fix, due to the requirements spelled out in the utimensat(2) man page: if the current user has write permission but is not the owner of the file, it may set both atime and mtime to UTIME_NOW, but any other combination is forbidden. Although in theory we could still leave the atime alone in other cases, it's not worth the complexity: atime is often unreliable and Bazel doesn't care about it, anyway.

Unfortunately, it's difficult to write an integration test for this, because we can't arrange for the existence of multiple users in our CI environment.

Fixes #23512.

PiperOrigin-RevId: 729042375
Change-Id: I7ca5e8bc0858a9796f448fca554d0c9465579e19

Commit e7aef80

The earlier attempt in bazelbuild@e9a18ce was not the correct fix, due to the requirements spelled out in the utimensat(2) man page: if the current user has write permission but is not the owner of the file, it may set both atime and mtime to UTIME_NOW, but any other combination is forbidden. Although in theory we could still leave the atime alone in other cases, it's not worth the complexity: atime is often unreliable and Bazel doesn't care about it, anyway.

Unfortunately, it's difficult to write an integration test for this, because we can't arrange for the existence of multiple users in our CI environment.

Fixes bazelbuild#23512.

PiperOrigin-RevId: 729042375
Change-Id: I7ca5e8bc0858a9796f448fca554d0c9465579e19
@bazel-io bazel-io requested a review from a team as a code owner March 4, 2025 22:49
@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 Mar 4, 2025
@bazel-io bazel-io requested a review from tjgq March 4, 2025 22:49
@iancha1992 iancha1992 enabled auto-merge (squash) March 4, 2025 22:50
@iancha1992 iancha1992 disabled auto-merge March 5, 2025 19:12
@iancha1992 iancha1992 added this pull request to the merge queue Mar 5, 2025
Merged via the queue into bazelbuild:release-7.6.0 with commit 3a27ba9 Mar 5, 2025
51 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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