Skip to content

Conversation

@bazel-io
Copy link
Member

FileSystemValueCheckerInferringAncestors claims that it is resilient to diffs which only report the root of a deleted subtree, but this wasn't true. Stale FileStateValues and DirectoryListingStateValues could linger around after moving an entire directory tree out of the workspace watched with --watchfs.

This is fixed by invalidating all FSVs and DLSVs under any deleted directory. Since these values and their keys do not depend on their parents, this requires a manual walk of the entire graph, making use of a prefix-free sorted map to speed up lookups per key.

Fixes #26863
Fixes #26866

Closes #26920.

PiperOrigin-RevId: 812740160
Change-Id: Id55329b5ffd3cf3e109ec102e86b6fb46335531b

Commit 8df327a

@bazel-io bazel-io requested a review from a team as a code owner September 29, 2025 12:17
@bazel-io bazel-io added team-Core Skyframe, bazel query, BEP, options parsing, bazelrc awaiting-review PR is awaiting review from an assigned reviewer labels Sep 29, 2025
@iancha1992 iancha1992 enabled auto-merge October 3, 2025 20:41
@iancha1992 iancha1992 requested a review from lberki October 3, 2025 20:41
@iancha1992
Copy link
Member

@lberki Could you please take a look at the presubmit failures? Thanks!

@fmeum
Copy link
Collaborator

fmeum commented Oct 9, 2025

@iancha1992 Could you apply this diff?

--- a/src/main/java/com/google/devtools/build/lib/skyframe/FileSystemValueCheckerInferringAncestors.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/FileSystemValueCheckerInferringAncestors.java
@@ -341,7 +341,7 @@ public final class FileSystemValueCheckerInferringAncestors {
     boolean typeChanged = newFsv.getType() != oldFsv.getType();
     if (typeChanged) {
       parentListingKey(path).ifPresent(valuesToInvalidate::add);
-      if (oldFsv.isDirectory() && !newFsv.exists()) {
+      if (oldFsv.getType().isDirectory() && !newFsv.getType().exists()) {
         deletedDirectories.add(path);
       }
     }

@iancha1992 iancha1992 added this pull request to the merge queue Oct 13, 2025
github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2025
`FileSystemValueCheckerInferringAncestors` claims that it is resilient
to diffs which only report the root of a deleted subtree, but this
wasn't true. Stale `FileStateValue`s and `DirectoryListingStateValue`s
could linger around after moving an entire directory tree out of the
workspace watched with `--watchfs`.

This is fixed by invalidating all FSVs and DLSVs under any deleted
directory. Since these values and their keys do not depend on their
parents, this requires a manual walk of the entire graph, making use of
a prefix-free sorted map to speed up lookups per key.

Fixes #26863
Fixes #26866

Closes #26920.

PiperOrigin-RevId: 812740160
Change-Id: Id55329b5ffd3cf3e109ec102e86b6fb46335531b

Commit
8df327a

---------

Co-authored-by: Fabian Meumertzheim <[email protected]>
Co-authored-by: Ian (Hee) Cha <[email protected]>
@lberki lberki added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@iancha1992 iancha1992 removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Oct 13, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
fmeum and others added 2 commits October 14, 2025 11:04
`FileSystemValueCheckerInferringAncestors` claims that it is resilient to diffs which only report the root of a deleted subtree, but this wasn't true. Stale `FileStateValue`s and `DirectoryListingStateValue`s could linger around after moving an entire directory tree out of the workspace watched with `--watchfs`.

This is fixed by invalidating all FSVs and DLSVs under any deleted directory. Since these values and their keys do not depend on their parents, this requires a manual walk of the entire graph, making use of a prefix-free sorted map to speed up lookups per key.

Fixes bazelbuild#26863
Fixes bazelbuild#26866

Closes bazelbuild#26920.

PiperOrigin-RevId: 812740160
Change-Id: Id55329b5ffd3cf3e109ec102e86b6fb46335531b
…mValueCheckerInferringAncestors.java

Co-authored-by: Fabian Meumertzheim <[email protected]>
@iancha1992 iancha1992 enabled auto-merge October 14, 2025 18:05
@iancha1992 iancha1992 added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 14, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 15, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 17, 2025
@iancha1992 iancha1992 added this pull request to the merge queue Oct 17, 2025
Merged via the queue into bazelbuild:release-7.7.0 with commit f4f39f0 Oct 17, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Core Skyframe, bazel query, BEP, options parsing, bazelrc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants