diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-09-10 13:19:45 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-09-10 13:19:45 +0200 |
commit | 8e36bb103d0bc47dcae02e7cfa5f6db37e83d887 (patch) | |
tree | c05cf4be6c245ce7668a8a9da2a8a741825f23ff /controller-server | |
parent | 2871102f1f8c95a4d4b6194d47e3a3cf0fb8e4c4 (diff) |
Catch exceptions in JobRunner, rather than leaking to stderr
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunner.java | 12 |
1 files changed, 11 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 f13c31de5d7..26f2ce02ec2 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 @@ -18,6 +18,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -73,11 +74,20 @@ public class JobRunner extends Maintainer { advance(jobs.run(run.id()).get()); } else if (run.readySteps().isEmpty()) - executors.execute(() -> jobs.finish(run.id())); + executors.execute(() -> finish(run.id())); else run.readySteps().forEach(step -> executors.execute(() -> advance(run.id(), step))); } + private void finish(RunId id) { + try { + jobs.finish(id); + } + catch (Exception e) { + log.log(LogLevel.WARNING, "Exception finishing " + id, e); + } + } + /** Attempts to advance the status of the given step, for the given run. */ private void advance(RunId id, Step step) { try { |