diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2023-05-12 09:52:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 09:52:35 +0200 |
commit | 4fcbaf3415490b0563b50d492ce87ce06e8b966a (patch) | |
tree | 853878e89743d224a67ba6edb44ec803e1ca9bcf | |
parent | bfb8fc17f23afc00d976a5040ac5e70f2d2ad13a (diff) | |
parent | 325f9dde0134804fbfa00e5144b9cf8759eeb760 (diff) |
Merge pull request #27086 from vespa-engine/jonmv/impose-job-pauses-over-other-status
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.java | 15 |
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() |