aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/EagerInvalidator.java13
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java14
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java12
3 files changed, 27 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/EagerInvalidator.java b/src/main/java/com/google/devtools/build/skyframe/EagerInvalidator.java
index 49bcfa0165..bb6d2b2685 100644
--- a/src/main/java/com/google/devtools/build/skyframe/EagerInvalidator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/EagerInvalidator.java
@@ -15,6 +15,7 @@ package com.google.devtools.build.skyframe;
import com.google.common.base.Function;
import com.google.devtools.build.lib.concurrent.AbstractQueueVisitor;
+import com.google.devtools.build.lib.concurrent.ErrorHandler;
import com.google.devtools.build.lib.concurrent.ExecutorParams;
import com.google.devtools.build.skyframe.InvalidatingNodeVisitor.DeletingNodeVisitor;
import com.google.devtools.build.skyframe.InvalidatingNodeVisitor.DirtyingNodeVisitor;
@@ -89,7 +90,8 @@ public final class EagerInvalidator {
InvalidationState state,
DirtyKeyTracker dirtyKeyTracker,
ForkJoinPool forkJoinPool,
- boolean supportInterruptions) {
+ boolean supportInterruptions,
+ ErrorHandler errorHandler) {
state.update(diff);
return state.isEmpty()
? null
@@ -99,7 +101,8 @@ public final class EagerInvalidator {
state,
dirtyKeyTracker,
forkJoinPool,
- supportInterruptions);
+ supportInterruptions,
+ errorHandler);
}
/**
@@ -133,7 +136,8 @@ public final class EagerInvalidator {
InvalidationState state,
DirtyKeyTracker dirtyKeyTracker,
ForkJoinPool forkJoinPool,
- boolean supportInterruptions)
+ boolean supportInterruptions,
+ ErrorHandler errorHandler)
throws InterruptedException {
DirtyingNodeVisitor visitor =
createInvalidatingVisitorIfNeeded(
@@ -143,7 +147,8 @@ public final class EagerInvalidator {
state,
dirtyKeyTracker,
forkJoinPool,
- supportInterruptions);
+ supportInterruptions,
+ errorHandler);
if (visitor != null) {
visitor.run();
}
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 78421cb3e7..bb7f05dd69 100644
--- a/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
+++ b/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
@@ -22,6 +22,7 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import com.google.devtools.build.lib.concurrent.AbstractQueueVisitor;
import com.google.devtools.build.lib.concurrent.ErrorClassifier;
+import com.google.devtools.build.lib.concurrent.ErrorHandler;
import com.google.devtools.build.lib.concurrent.ExecutorParams;
import com.google.devtools.build.lib.concurrent.ForkJoinQuiescingExecutor;
import com.google.devtools.build.lib.concurrent.QuiescingExecutor;
@@ -112,7 +113,8 @@ public abstract class InvalidatingNodeVisitor<TGraph extends ThinNodeQueryableGr
/*failFastOnInterrupt=*/ true,
"skyframe-invalidator",
executorFactory,
- errorClassifier);
+ errorClassifier,
+ ErrorHandler.NullHandler.INSTANCE);
this.graph = Preconditions.checkNotNull(graph);
this.invalidationReceiver = invalidationReceiver;
this.dirtyKeyTracker = Preconditions.checkNotNull(dirtyKeyTracker);
@@ -124,8 +126,9 @@ public abstract class InvalidatingNodeVisitor<TGraph extends ThinNodeQueryableGr
@Nullable EvaluationProgressReceiver invalidationReceiver,
InvalidationState state,
DirtyKeyTracker dirtyKeyTracker,
- ForkJoinPool forkJoinPool) {
- this.executor = new ForkJoinQuiescingExecutor(forkJoinPool, errorClassifier);
+ ForkJoinPool forkJoinPool,
+ ErrorHandler errorHandler) {
+ this.executor = new ForkJoinQuiescingExecutor(forkJoinPool, errorClassifier, errorHandler);
this.graph = Preconditions.checkNotNull(graph);
this.invalidationReceiver = invalidationReceiver;
this.dirtyKeyTracker = Preconditions.checkNotNull(dirtyKeyTracker);
@@ -368,8 +371,9 @@ public abstract class InvalidatingNodeVisitor<TGraph extends ThinNodeQueryableGr
InvalidationState state,
DirtyKeyTracker dirtyKeyTracker,
ForkJoinPool forkJoinPool,
- boolean supportInterruptions) {
- super(graph, invalidationReceiver, state, dirtyKeyTracker, forkJoinPool);
+ boolean supportInterruptions,
+ ErrorHandler errorHandler) {
+ super(graph, invalidationReceiver, state, dirtyKeyTracker, forkJoinPool, errorHandler);
this.supportInterruptions = supportInterruptions;
}
diff --git a/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java
index b88ef42b61..d9307c6132 100644
--- a/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java
@@ -30,6 +30,7 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.NestedSetVisitor;
import com.google.devtools.build.lib.concurrent.AbstractQueueVisitor;
import com.google.devtools.build.lib.concurrent.ErrorClassifier;
+import com.google.devtools.build.lib.concurrent.ErrorHandler;
import com.google.devtools.build.lib.concurrent.ForkJoinQuiescingExecutor;
import com.google.devtools.build.lib.concurrent.QuiescingExecutor;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible;
@@ -147,6 +148,7 @@ public final class ParallelEvaluator implements Evaluator {
private final DirtyKeyTracker dirtyKeyTracker;
private final Receiver<Collection<SkyKey>> inflightKeysReceiver;
private final EventFilter storedEventFilter;
+ private final ErrorHandler errorHandler;
public ParallelEvaluator(
ProcessableGraph graph,
@@ -174,6 +176,7 @@ public final class ParallelEvaluator implements Evaluator {
new NestedSetVisitor<>(new NestedSetEventReceiver(reporter), emittedEventState);
this.storedEventFilter = storedEventFilter;
this.forkJoinPool = null;
+ this.errorHandler = ErrorHandler.NullHandler.INSTANCE;
}
public ParallelEvaluator(
@@ -188,7 +191,8 @@ public final class ParallelEvaluator implements Evaluator {
@Nullable EvaluationProgressReceiver progressReceiver,
DirtyKeyTracker dirtyKeyTracker,
Receiver<Collection<SkyKey>> inflightKeysReceiver,
- ForkJoinPool forkJoinPool) {
+ ForkJoinPool forkJoinPool,
+ ErrorHandler errorHandler) {
this.graph = graph;
this.skyFunctions = skyFunctions;
this.graphVersion = graphVersion;
@@ -204,6 +208,7 @@ public final class ParallelEvaluator implements Evaluator {
new NestedSetVisitor<>(new NestedSetEventReceiver(reporter), emittedEventState);
this.storedEventFilter = storedEventFilter;
this.forkJoinPool = Preconditions.checkNotNull(forkJoinPool);
+ this.errorHandler = errorHandler;
}
/**
@@ -700,7 +705,7 @@ public final class ParallelEvaluator implements Evaluator {
private ValueVisitor(ForkJoinPool forkJoinPool) {
quiescingExecutor =
- new ForkJoinQuiescingExecutor(forkJoinPool, VALUE_VISITOR_ERROR_CLASSIFIER);
+ new ForkJoinQuiescingExecutor(forkJoinPool, VALUE_VISITOR_ERROR_CLASSIFIER, errorHandler);
}
private ValueVisitor(int threadCount) {
@@ -713,7 +718,8 @@ public final class ParallelEvaluator implements Evaluator {
/*failFastOnException*/ true,
/*failFastOnInterrupt*/ true,
"skyframe-evaluator",
- VALUE_VISITOR_ERROR_CLASSIFIER);
+ VALUE_VISITOR_ERROR_CLASSIFIER,
+ errorHandler);
}
private void waitForCompletion() throws InterruptedException {