aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-08-11 01:15:11 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-08-11 12:56:45 +0200
commit53b9babf72f7841ad0fab8b30d4b6d9dd5b34437 (patch)
tree3e5ba12e30596d0a4117981946973eca28259515 /src/main/java/com/google/devtools/build/lib/skyframe
parent4bc9509dadfb13255ae7db896718d55d87599aef (diff)
Set a bit in ActionExecutedEvent indicating if a failure occurred before the action actually executed.
PiperOrigin-RevId: 164917959
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
index d628a88ad7..be0ba39ae3 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -28,6 +28,7 @@ import com.google.devtools.build.lib.actions.ActionCacheChecker.Token;
import com.google.devtools.build.lib.actions.ActionCompletionEvent;
import com.google.devtools.build.lib.actions.ActionContext;
import com.google.devtools.build.lib.actions.ActionExecutedEvent;
+import com.google.devtools.build.lib.actions.ActionExecutedEvent.ErrorTiming;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
import com.google.devtools.build.lib.actions.ActionExecutionContextFactory;
import com.google.devtools.build.lib.actions.ActionExecutionException;
@@ -581,7 +582,8 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto
try {
return action.discoverInputs(actionExecutionContext);
} catch (ActionExecutionException e) {
- throw processAndThrow(e, action, actionExecutionContext.getFileOutErr());
+ throw processAndThrow(
+ e, action, actionExecutionContext.getFileOutErr(), ErrorTiming.BEFORE_EXECUTION);
}
}
@@ -796,10 +798,10 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto
}
}
- ActionExecutionException processAndThrow(
- ActionExecutionException e, Action action, FileOutErr outErrBuffer)
+ private ActionExecutionException processAndThrow(
+ ActionExecutionException e, Action action, FileOutErr outErrBuffer, ErrorTiming errorTiming)
throws ActionExecutionException {
- reportActionExecution(action, e, outErrBuffer);
+ reportActionExecution(action, e, outErrBuffer, errorTiming);
boolean reported = reportErrorIfNotAbortingMode(e, outErrBuffer);
ActionExecutionException toThrow = e;
@@ -858,7 +860,7 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto
}
// Defer reporting action success until outputs are checked
} catch (ActionExecutionException e) {
- processAndThrow(e, action, outErrBuffer);
+ throw processAndThrow(e, action, outErrBuffer, ErrorTiming.AFTER_EXECUTION);
} finally {
profiler.completeTask(ProfilerTask.ACTION_EXECUTE);
}
@@ -889,15 +891,18 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto
}
}
- reportActionExecution(action, null, fileOutErr);
+ reportActionExecution(action, null, fileOutErr, ErrorTiming.NO_ERROR);
} catch (ActionExecutionException actionException) {
// Success in execution but failure in completion.
- reportActionExecution(action, actionException, fileOutErr);
+ reportActionExecution(action, actionException, fileOutErr, ErrorTiming.AFTER_EXECUTION);
throw actionException;
} catch (IllegalStateException exception) {
// More serious internal error, but failure still reported.
- reportActionExecution(action,
- new ActionExecutionException(exception, action, true), fileOutErr);
+ reportActionExecution(
+ action,
+ new ActionExecutionException(exception, action, true),
+ fileOutErr,
+ ErrorTiming.AFTER_EXECUTION);
throw exception;
}
}
@@ -1074,8 +1079,11 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto
}
}
- private void reportActionExecution(Action action,
- ActionExecutionException exception, FileOutErr outErr) {
+ private void reportActionExecution(
+ Action action,
+ ActionExecutionException exception,
+ FileOutErr outErr,
+ ErrorTiming errorTiming) {
Path stdout = null;
Path stderr = null;
@@ -1085,7 +1093,7 @@ public final class SkyframeActionExecutor implements ActionExecutionContextFacto
if (outErr.hasRecordedStderr()) {
stderr = outErr.getErrorPath();
}
- postEvent(new ActionExecutedEvent(action, exception, stdout, stderr));
+ postEvent(new ActionExecutedEvent(action, exception, stdout, stderr, errorTiming));
}
/**