Skip to content
Permalink
Browse files

[FIXED JENKINS-39072] Include status information for a running timeou…

…t step.
  • Loading branch information
jglick committed Oct 24, 2016
1 parent 040ed79 commit 83dfe040379f49806b6adc19b2bd11ad396ce1c2
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java
@@ -132,6 +132,27 @@ public void stop(Throwable cause) throws Exception {
body.cancel(cause);
}

@Override public String getStatus() {
if (killer == null) {
return "killer task nowhere to be found";
} else if (killer.isCancelled()) {
return "killer task was cancelled";
} else if (killer.isDone()) {
return "killer task reported done";
} else {
long delay = end - System.currentTimeMillis();
if (delay <= 0) {
return "overshot by " + Util.getTimeSpanString(-delay);
}
String delayS = Util.getTimeSpanString(delay);
if (forcible) {
return "body did not yet respond to signal; forcibly killing in " + delayS;
} else {
return "body has another " + delayS + " to run";
}
}
}

private class Callback extends BodyExecutionCallback.TailCall {

@Override protected void finished(StepContext context) throws Exception {

0 comments on commit 83dfe04

Please sign in to comment.
You can’t perform that action at this time.