aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-01-05 14:36:32 +0100
committerMartin Polden <mpolden@mpolden.no>2022-01-05 15:10:51 +0100
commit3c5a7dc42df3b813042f8ebc28fca252cb3a8d12 (patch)
treec113f5a1c35b6e893729bb6268fcc106960527f6 /controller-server/src/main
parentcfaa0be19da00466a73b57a9630477eabe46a8bd (diff)
Let repeated deployments surface as bad request
Diffstat (limited to 'controller-server/src/main')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
index fe4b3956f9b..6e5218917bf 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
@@ -3,7 +3,6 @@ package com.yahoo.vespa.hosted.controller.deployment;
import com.google.common.collect.ImmutableSortedMap;
import com.yahoo.component.Version;
-import com.yahoo.config.application.api.DeploymentSpec;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.zone.ZoneId;
import com.yahoo.vespa.curator.Lock;
@@ -482,7 +481,7 @@ public class JobController {
locked(id, type, __ -> {
Optional<Run> last = last(id, type);
if (last.flatMap(run -> active(run.id())).isPresent())
- throw new IllegalStateException("Can not start " + type + " for " + id + "; it is already running!");
+ throw new IllegalArgumentException("Cannot start " + type + " for " + id + "; it is already running!");
RunId newId = new RunId(id, type, last.map(run -> run.id().number()).orElse(0L) + 1);
curator.writeLastRun(Run.initial(newId, versions, isRedeployment, controller.clock().instant(), profile));