Skip to content

Commit

Permalink
Add some more logging for IOException propagation: if a "synthetic" e…
Browse files Browse the repository at this point in the history
…rror info is constructed from child error infos that has an IOException, and if the build is aborted due to a child error info that has an IOException.

PiperOrigin-RevId: 361161797
  • Loading branch information
janakdr authored and copybara-github committed Mar 5, 2021
1 parent 5e03a2c commit 374457f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ public void run() {
childErrorKey,
childErrorInfoMaybe);
evaluatorContext.getVisitor().preventNewEvaluations();
// TODO(b/166268889): Remove when fixed.
if (childErrorInfo.getException() instanceof IOException) {
logger.atInfo().withCause(childErrorInfo.getException()).log(
"Child %s with IOException forced abort of %s", childErrorKey, skyKey);
}
throw SchedulerException.ofError(childErrorInfo, childErrorKey, ImmutableSet.of(skyKey));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.flogger.GoogleLogger;
import com.google.devtools.build.lib.collect.compacthashmap.CompactHashMap;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
Expand All @@ -39,6 +40,7 @@
import com.google.devtools.build.skyframe.ParallelEvaluatorContext.EnqueueParentBehavior;
import com.google.devtools.build.skyframe.QueryableGraph.Reason;
import com.google.devtools.build.skyframe.proto.GraphInconsistency.Inconsistency;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
Expand All @@ -53,7 +55,7 @@

/** A {@link SkyFunction.Environment} implementation for {@link ParallelEvaluator}. */
class SkyFunctionEnvironment extends AbstractSkyFunctionEnvironment {

private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();
private static final SkyValue NULL_MARKER = new SkyValue() {};
private static final boolean PREFETCH_OLD_DEPS =
Boolean.parseBoolean(
Expand Down Expand Up @@ -822,6 +824,11 @@ Set<SkyKey> commit(NodeEntry primaryEntry, EnqueueParentBehavior enqueueParents)
if (errorInfo == null) {
errorInfo = evaluatorContext.getErrorInfoManager().getErrorInfoToUse(
skyKey, value != null, childErrorInfos);
// TODO(b/166268889): remove when fixed.
if (errorInfo != null && errorInfo.getException() instanceof IOException) {
logger.atInfo().withCause(errorInfo.getException()).log(
"Synthetic errorInfo for %s", skyKey);
}
}

// We have the following implications:
Expand Down

0 comments on commit 374457f

Please sign in to comment.