diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-10-13 17:31:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 17:31:40 +0200 |
commit | 376407f08ea7cd2c8fd82f6c55915e20d0c75a1a (patch) | |
tree | 090bf29f3becd54f17df54235ef74ff558822b5d /configserver/src/main | |
parent | eeb50569030bbd69407f734f2e670ffd6820b785 (diff) | |
parent | f4d482c509c00aa960b74de4e24f7c9e8b9eb361 (diff) |
Merge pull request #19526 from vespa-engine/hmusum/move-ActivationConflictException
Move ActivationConflictException to config-provisioning [run-systemtest]
Diffstat (limited to 'configserver/src/main')
3 files changed, 5 insertions, 19 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ActivationConflictException.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ActivationConflictException.java deleted file mode 100644 index 8dac35616f0..00000000000 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/ActivationConflictException.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.config.server; - -/** - * Exception used when activation cannot be done because activation is for - * an older session than the one that is active now or because current active - * session has changed since the session to be activated was created - * - * @author hmusum - */ -public class ActivationConflictException extends RuntimeException { - public ActivationConflictException(String s) { - super(s); - } -} diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java index 368324fa843..e0629a2e5db 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java @@ -22,6 +22,7 @@ import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.Zone; +import com.yahoo.config.provision.exception.ActivationConflictException; import com.yahoo.container.jdisc.HttpResponse; import com.yahoo.container.jdisc.SecretStoreProvider; import com.yahoo.container.jdisc.secretstore.SecretStore; @@ -486,7 +487,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye // Config generation is equal to session id, and config generation must be a monotonically increasing number static void checkIfActiveIsNewerThanSessionToBeActivated(long sessionId, long currentActiveSessionId) { if (sessionId < currentActiveSessionId) { - throw new ActivationConflictException("It is not possible to activate session " + sessionId + + throw new ActivationConflictException("Cannot activate session " + sessionId + ", because it is older than current active session (" + currentActiveSessionId + ")"); } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java index ea7d0e03812..2dad2c060cc 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/HttpHandler.java @@ -3,19 +3,19 @@ package com.yahoo.vespa.config.server.http; import com.yahoo.config.provision.ApplicationLockException; import com.yahoo.config.provision.CertificateNotReadyException; +import com.yahoo.config.provision.OutOfCapacityException; import com.yahoo.config.provision.ParentHostUnavailableException; +import com.yahoo.config.provision.exception.ActivationConflictException; import com.yahoo.config.provision.exception.LoadBalancerServiceException; import com.yahoo.container.jdisc.HttpRequest; import com.yahoo.container.jdisc.HttpResponse; import com.yahoo.container.jdisc.LoggingRequestHandler; -import java.util.logging.Level; -import com.yahoo.config.provision.OutOfCapacityException; -import com.yahoo.vespa.config.server.ActivationConflictException; import com.yahoo.yolean.Exceptions; import java.io.PrintWriter; import java.io.StringWriter; import java.time.Duration; +import java.util.logging.Level; /** * Super class for http handlers, that takes care of checking valid |