diff options
author | Googler <noreply@google.com> | 2016-09-13 14:51:46 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2016-09-14 09:34:04 +0000 |
commit | 7a0b5187052859c3c7c204dcc2067805bd69cb3d (patch) | |
tree | 5a719f4c8e311503a6efdd5714ceefeab237b73d /src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java | |
parent | 47549f90412387ee69383d4ec7fa299e551f3040 (diff) |
Allow reverse dependency lookups on Skyframe graph to throw InteruptedException
--
MOS_MIGRATED_REVID=132999234
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java b/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java index 096fc2d49b..8af633d2c4 100644 --- a/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java +++ b/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java @@ -282,7 +282,16 @@ public abstract class InvalidatingNodeVisitor<TGraph extends QueryableGraph> { if (traverseGraph) { // Propagate deletion upwards. - visit(entry.getReverseDeps(), InvalidationType.DELETED); + try { + visit(entry.getReverseDeps(), InvalidationType.DELETED); + } catch (InterruptedException e) { + throw new IllegalStateException( + "Deletion cannot happen on a graph that may have blocking operations: " + + key + + ", " + + entry, + e); + } // Unregister this node as an rdep from its direct deps, since reverse dep // edges cannot point to non-existent nodes. To know whether the child has this @@ -318,7 +327,17 @@ public abstract class InvalidatingNodeVisitor<TGraph extends QueryableGraph> { NodeEntry dep = directDepEntry.getValue(); if (dep != null) { if (dep.isDone() || !signalingDeps.contains(directDepEntry.getKey())) { - dep.removeReverseDep(key); + try { + dep.removeReverseDep(key); + } catch (InterruptedException e) { + throw new IllegalStateException( + "Deletion cannot happen on a graph that may have blocking " + + "operations: " + + key + + ", " + + entry, + e); + } } else { // This step is not strictly necessary, since all in-progress nodes are // deleted during graph cleaning, which happens in a single |