aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-02-10 20:30:41 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-02-11 11:49:33 +0000
commit1acd4666ec48240e0044e692fadb0c3101b0d3ae (patch)
tree5715a12d0b772f897393f1a9b02485d2b3a3c1ff /src/main/java/com/google/devtools
parent076f4ab33a9c2b4aee288e048b2fe9e4871bec07 (diff)
Allow ParallelEvaluator to not store errors alongside values if nodes recover from errors. In the case of a single keep_going build, with no subsequent nokeep_going builds, storing the errors is unnecessary.
-- MOS_MIGRATED_REVID=114355846
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java15
1 files changed, 13 insertions, 2 deletions
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 e5e8e6c322..ff885d8dbe 100644
--- a/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java
@@ -139,6 +139,7 @@ public final class ParallelEvaluator implements Evaluator {
private final EventHandler reporter;
private final NestedSetVisitor<TaggedEvents> replayingNestedSetEventVisitor;
private final boolean keepGoing;
+ private final boolean storeErrorsAlongsideValues;
private final int threadCount;
@Nullable private final ForkJoinPool forkJoinPool;
@Nullable private final EvaluationProgressReceiver progressReceiver;
@@ -164,6 +165,7 @@ public final class ParallelEvaluator implements Evaluator {
this.inflightKeysReceiver = inflightKeysReceiver;
this.reporter = Preconditions.checkNotNull(reporter);
this.keepGoing = keepGoing;
+ this.storeErrorsAlongsideValues = true;
this.threadCount = threadCount;
this.progressReceiver = progressReceiver;
this.dirtyKeyTracker = Preconditions.checkNotNull(dirtyKeyTracker);
@@ -181,6 +183,7 @@ public final class ParallelEvaluator implements Evaluator {
EmittedEventState emittedEventState,
EventFilter storedEventFilter,
boolean keepGoing,
+ boolean storeErrorsAlongsideValues,
@Nullable EvaluationProgressReceiver progressReceiver,
DirtyKeyTracker dirtyKeyTracker,
Receiver<Collection<SkyKey>> inflightKeysReceiver,
@@ -191,6 +194,8 @@ public final class ParallelEvaluator implements Evaluator {
this.inflightKeysReceiver = inflightKeysReceiver;
this.reporter = Preconditions.checkNotNull(reporter);
this.keepGoing = keepGoing;
+ this.storeErrorsAlongsideValues = storeErrorsAlongsideValues;
+ Preconditions.checkState(storeErrorsAlongsideValues || keepGoing);
this.threadCount = 0;
this.progressReceiver = progressReceiver;
this.dirtyKeyTracker = Preconditions.checkNotNull(dirtyKeyTracker);
@@ -332,10 +337,16 @@ public final class ParallelEvaluator implements Evaluator {
* <p>Child errors are remembered, if there are any and yet the parent recovered without
* error, so that subsequent noKeepGoing evaluations can stop as soon as they encounter a
* node whose (transitive) children had experienced an error, even if that (transitive)
- * parent node had been able to recover from it during a keepGoing build.
+ * parent node had been able to recover from it during a keepGoing build. This behavior can be
+ * suppressed by setting {@link #storeErrorsAlongsideValues} to false, which will cause nodes
+ * with values to have no stored error info. This may be useful if this graph will only ever be
+ * used for keepGoing builds, since in that case storing errors from recovered nodes is
+ * pointless.
*/
private void finalizeErrorInfo() {
- if (errorInfo == null && !childErrorInfos.isEmpty()) {
+ if (errorInfo == null
+ && (storeErrorsAlongsideValues || value == null)
+ && !childErrorInfos.isEmpty()) {
errorInfo = ErrorInfo.fromChildErrors(skyKey, childErrorInfos);
}
}