Skip to content

Commit

Permalink
[FIXED JENKINS-39072] Include status information for a running timeou…
Browse files Browse the repository at this point in the history
…t step.
  • Loading branch information
jglick committed Oct 24, 2016
1 parent 040ed79 commit 83dfe04
Showing 1 changed file with 21 additions and 0 deletions.
Expand Up @@ -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 {
Expand Down

0 comments on commit 83dfe04

Please sign in to comment.