diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-08-23 00:13:40 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-08-23 00:13:40 +0200 |
commit | 6a4eab4dce7057e88dec8dd42e3f9ce3a7bcd558 (patch) | |
tree | 951aca81d4af52a7f3a26836b94fd8fe595c58b6 /controller-server | |
parent | 43402b23dc74fe6550d231b26e8c50327e1971f9 (diff) |
Try to run steps again if we bail out due to status change
If someone completes a step we are trying to run, we will bail out. Meanwhile, that other thread will attempt the next step, but fails to acquire the lock, since we hold it (for the prerequisite), so that thread gives up. When it is our turn again, and we bail out, we should try again to run any ready steps, otherwise we may lose the fact that _someone_ ought to do _something_. This is absolutely not a practical issue, but makes one unit test slightly unstable :)
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java index 25207b733f0..3e710b59d50 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java @@ -113,8 +113,10 @@ public class JobRunner extends ControllerMaintainer { jobs.locked(id.application(), id.type(), step, lockedStep -> { jobs.locked(id, run -> run); // Memory visibility. jobs.active(id).ifPresent(run -> { // The run may have become inactive, so we bail out. - if ( ! run.readySteps().contains(step)) + if ( ! run.readySteps().contains(step)) { + changed.set(true); return; // Someone may have updated the run status, making this step obsolete, so we bail out. + } StepInfo stepInfo = run.stepInfo(lockedStep.get()).orElseThrow(); if (stepInfo.startTime().isEmpty()) { |