[Skymeld] Log an unexpected inconsistency instead of crashing in `SkymeldInconsistencyReceiver`.
... and allow the build to continue.
In the recent past, the crashes here were a little excessive as the solution
were always to add more cases into the allowlist. This provides a less disruptive
way to discover the not-yet-expected cases.
PiperOrigin-RevId: 552774378
Change-Id: I588c2bdad5a37d01bd3716d7a22ee5a9d029f7fd
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/BUILD b/src/main/java/com/google/devtools/build/lib/skyframe/BUILD
index cb4d9c7..64b14d6 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/BUILD
@@ -3018,6 +3018,7 @@
deps = [
":node_dropping_inconsistency_receiver",
":sky_functions",
+ "//src/main/java/com/google/devtools/build/lib/bugreport",
"//src/main/java/com/google/devtools/build/skyframe",
"//src/main/java/com/google/devtools/build/skyframe:graph_inconsistency_java_proto",
"//src/main/java/com/google/devtools/build/skyframe:skyframe-objects",
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkymeldInconsistencyReceiver.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkymeldInconsistencyReceiver.java
index 70ca31d..c25984e 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkymeldInconsistencyReceiver.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkymeldInconsistencyReceiver.java
@@ -13,9 +13,9 @@
// limitations under the License.
package com.google.devtools.build.lib.skyframe;
-import static com.google.common.base.Preconditions.checkState;
import com.google.common.collect.ImmutableMap;
+import com.google.devtools.build.lib.bugreport.BugReport;
import com.google.devtools.build.skyframe.GraphInconsistencyReceiver;
import com.google.devtools.build.skyframe.SkyFunctionName;
import com.google.devtools.build.skyframe.SkyKey;
@@ -51,12 +51,12 @@
return;
}
- checkState(
- NodeDroppingInconsistencyReceiver.isExpectedInconsistency(
- key, otherKeys, inconsistency, SKYMELD_EXPECTED_MISSING_CHILDREN),
- "Unexpected inconsistency: %s, %s, %s",
- key,
- otherKeys,
- inconsistency);
+ if (!NodeDroppingInconsistencyReceiver.isExpectedInconsistency(
+ key, otherKeys, inconsistency, SKYMELD_EXPECTED_MISSING_CHILDREN)) {
+ // Instead of crashing, simply send a bug report here so we can evaluate whether this is an
+ // actual bug or just something else to be added to the expected list.
+ BugReport.logUnexpected(
+ "Unexpected inconsistency: %s, %s, %s", key, otherKeys, inconsistency);
+ }
}
}