diff options
author | 2017-06-14 13:40:23 +0200 | |
---|---|---|
committer | 2017-06-14 16:20:26 +0200 | |
commit | da0a701d010785b9687cf0548c460f5116f3b176 (patch) | |
tree | b2d6de174c18d14235bc770d231da61e6289fea7 /src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java | |
parent | 624c706e49076912350277db746f5d43c484e591 (diff) |
Propagate postable events further up
With the introduction of the ExtendedEventHandler, SkyFunctions were
given the possibility to post additional Postable events in addition
to the standard events. As SkyFunctions have to be restartable, events
are collected first and only posted after the function is finished.
Make sure that this also applies to postable events and they are not
dropped.
Change-Id: Ie1c3a0134935c75ea984fa2cc924e7327a9da81f
PiperOrigin-RevId: 158964337
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java | 22 |
1 files changed, 16 insertions, 6 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 261248b13a..0904405a17 100644 --- a/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java +++ b/src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java @@ -23,6 +23,7 @@ import com.google.common.collect.Iterables; import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.ExtendedEventHandler; +import com.google.devtools.build.lib.events.ExtendedEventHandler.Postable; import com.google.devtools.build.lib.profiler.Profiler; import com.google.devtools.build.lib.profiler.ProfilerTask; import com.google.devtools.build.lib.util.BlazeClock; @@ -1017,9 +1018,12 @@ public final class ParallelEvaluator implements Evaluator { if (reifiedBuilderException.getRootCauseSkyKey().equals(parent)) { error = ErrorInfo.fromException(reifiedBuilderException, /*isTransitivelyTransient=*/ false); - bubbleErrorInfo.put(errorKey, - ValueWithMetadata.error(ErrorInfo.fromChildErrors(errorKey, ImmutableSet.of(error)), - env.buildEvents(parentEntry, /*missingChildren=*/true))); + bubbleErrorInfo.put( + errorKey, + ValueWithMetadata.error( + ErrorInfo.fromChildErrors(errorKey, ImmutableSet.of(error)), + env.buildEvents(parentEntry, /*missingChildren=*/ true), + env.buildPosts(parentEntry))); continue; } } finally { @@ -1027,9 +1031,12 @@ public final class ParallelEvaluator implements Evaluator { Thread.interrupted(); } // Builder didn't throw an exception, so just propagate this one up. - bubbleErrorInfo.put(errorKey, - ValueWithMetadata.error(ErrorInfo.fromChildErrors(errorKey, ImmutableSet.of(error)), - env.buildEvents(parentEntry, /*missingChildren=*/true))); + bubbleErrorInfo.put( + errorKey, + ValueWithMetadata.error( + ErrorInfo.fromChildErrors(errorKey, ImmutableSet.of(error)), + env.buildEvents(parentEntry, /*missingChildren=*/ true), + env.buildPosts(parentEntry))); } // Reset the interrupt bit if there was an interrupt from outside this evaluator interrupt. @@ -1080,6 +1087,9 @@ public final class ParallelEvaluator implements Evaluator { continue; } SkyValue value = valueWithMetadata.getValue(); + for (Postable post : valueWithMetadata.getTransitivePostables()) { + evaluatorContext.getReporter().post(post); + } // TODO(bazel-team): Verify that message replay is fast and works in failure // modes [skyframe-core] // Note that replaying events here is only necessary on null builds, because otherwise we |