Change Pruned events are not being emitted immediately.
When there are parallel values being evaluated and one of them is change pruned, the issue was that the change pruned value was waiting on the other evaluation to complete first being before emitting its own event.
RELNOTES: Change Pruned events will fire immediately after being checked.
PiperOrigin-RevId: 266385398
diff --git a/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java b/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java
index 5cea4eb..1818083 100644
--- a/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java
+++ b/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java
@@ -537,7 +537,7 @@
}
@Override
- public synchronized Set<SkyKey> markClean() throws InterruptedException {
+ public synchronized NodeValueAndRdepsToSignal markClean() throws InterruptedException {
Preconditions.checkNotNull(dirtyBuildingState, this);
this.value = Preconditions.checkNotNull(dirtyBuildingState.getLastBuildValue());
Preconditions.checkState(isReady(), "Should be ready when clean: %s", this);
@@ -547,7 +547,8 @@
this);
Preconditions.checkState(isDirty(), this);
Preconditions.checkState(!dirtyBuildingState.isChanged(), "shouldn't be changed: %s", this);
- return setStateFinishedAndReturnReverseDepsToSignal();
+ Set<SkyKey> rDepsToSignal = setStateFinishedAndReturnReverseDepsToSignal();
+ return new NodeValueAndRdepsToSignal(this.getValueMaybeWithMetadata(), rDepsToSignal);
}
@Override