Skip to content
Permalink
Browse files

[JENKINS-48821] - Don't forget estimated duration of asynchronous jobs (

#3329)

* Don't forget estimated duration of asynchronous jobs.

When jobs are executed, the estimated duration is calculated, memorized
and reseted when the job is finished.

But when the job is executed asynchronously (e.g. as for pipeline
scripts), the execution is just triggered. Therefore the estimated
duration should remain - and not be reseted after triggering.

JENKINS-48821: Time remaining for all pipeline jobs is N/A
JENKINS-49616: Estimated time remaining NA

* Reset cached estimated duration also when asynchronous job ends.
  • Loading branch information...
bernolanger authored and oleg-nenashev committed Mar 10, 2018
1 parent 4f33d8a commit 3fc392108ae382a4616964aa8bbb6b8cb9dff0dc
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/hudson/model/Executor.java
@@ -459,7 +459,6 @@ public SubTask call() throws Exception {
if (asynchronousExecution == null) {
finish2();
}
executableEstimatedDuration = DEFAULT_ESTIMATED_DURATION;
}
}

@@ -490,6 +489,7 @@ private void finish2() {
if (this instanceof OneOffExecutor) {
owner.remove((OneOffExecutor) this);
}
executableEstimatedDuration = DEFAULT_ESTIMATED_DURATION;
queue.scheduleMaintenance();
}

0 comments on commit 3fc3921

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