aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-05-12 09:19:20 +0200
committerjonmv <venstad@gmail.com>2023-05-12 09:19:36 +0200
commit325f9dde0134804fbfa00e5144b9cf8759eeb760 (patch)
tree853878e89743d224a67ba6edb44ec803e1ca9bcf
parentbfb8fc17f23afc00d976a5040ac5e70f2d2ad13a (diff)
Impose job pauses over other delay causes for UI
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
index 2fc5ac10e6b..7f2b8c8a924 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java
@@ -271,15 +271,22 @@ class JobControllerApiHandlerHelper {
stepObject.setString("instance", stepStatus.instance().value());
// TODO: recursively search dependents for what is the relevant partial change when this is a delay step ...
- Readiness readiness = stepStatus.job().map(jobsToRun::get).map(job -> job.get(0).readiness())
- .orElse(stepStatus.readiness(change));
Instant now = controller.clock().instant();
+ Readiness readiness = stepStatus.pausedUntil().okAt(now)
+ ? stepStatus.job().map(jobsToRun::get).map(job -> job.get(0).readiness())
+ .orElse(stepStatus.readiness(change))
+ : stepStatus.pausedUntil();
if (readiness.ok()) {
+ // TODO jonmv: remove after UI changes.
stepObject.setLong("readyAt", readiness.at().toEpochMilli());
+
if ( ! readiness.okAt(now)) stepObject.setLong("delayedUntil", readiness.at().toEpochMilli());
}
+
+ // TODO jonmv: remove after UI changes.
if (readiness.cause() == DelayCause.coolingDown) stepObject.setLong("coolingDownUntil", readiness.at().toEpochMilli());
- if ( ! stepStatus.pausedUntil().okAt(now)) stepObject.setLong("pausedUntil", stepStatus.pausedUntil().at().toEpochMilli());
+ if (readiness.cause() == DelayCause.paused) stepObject.setLong("pausedUntil", readiness.at().toEpochMilli());
+
Readiness platformReadiness = stepStatus.blockedUntil(Change.of(controller.systemVersion(versionStatus))); // Dummy version — just anything with a platform.
if ( ! platformReadiness.okAt(now))
stepObject.setLong("platformBlockedUntil", platformReadiness.at().toEpochMilli());
@@ -365,7 +372,7 @@ class JobControllerApiHandlerHelper {
JobStatus jobStatus = status.jobs().get(job).get();
Cursor toRunArray = stepObject.setArray("toRun");
- showDelayCause = false;
+ showDelayCause = readiness.cause() == DelayCause.paused;
for (DeploymentStatus.Job versions : jobsToRun.getOrDefault(job, List.of())) {
boolean running = jobStatus.lastTriggered()
.map(run -> jobStatus.isRunning()