From c612d053afb16428865cc48e5bf71d257da8ee74 Mon Sep 17 00:00:00 2001 From: janakr Date: Tue, 22 Jan 2019 08:36:07 -0800 Subject: [PATCH] Check that all entries for previously registered new deps are in the graph. PiperOrigin-RevId: 230345568 --- .../build/skyframe/AbstractParallelEvaluator.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java index 51731f5c6fe800..d370623616a8dd 100644 --- a/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java +++ b/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java @@ -821,8 +821,18 @@ private boolean maybeHandleRegisteringNewlyDiscoveredDepsForDoneEntry( // removeUndoneNewlyRequestedDeps() just above this loop. However, with intra-evaluation // dirtying, a dep may not be done. boolean dirtyDepFound = false; - for (Map.Entry newDep : - graph.getBatch(skyKey, Reason.SIGNAL_DEP, previouslyRegisteredNewDeps).entrySet()) { + Map previouslyRegisteredEntries = + graph.getBatch(skyKey, Reason.SIGNAL_DEP, previouslyRegisteredNewDeps); + if (previouslyRegisteredEntries.size() != previouslyRegisteredNewDeps.size()) { + throw new IllegalStateException( + "Missing entries that were already known about: " + + Sets.difference(previouslyRegisteredNewDeps, previouslyRegisteredEntries.keySet()) + + " for " + + skyKey + + " with entry " + + entry); + } + for (Map.Entry newDep : previouslyRegisteredEntries.entrySet()) { DependencyState triState = newDep.getValue().checkIfDoneForDirtyReverseDep(skyKey); if (maybeHandleUndoneDepForDoneEntry(entry, triState, skyKey, newDep.getKey())) { dirtyDepFound = true;