diff options
author | HÃ¥kon Hallingstad <hakon@verizonmedia.com> | 2019-12-03 12:26:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-03 12:26:54 +0100 |
commit | 77406e88e658b2189ac31e715b564545c25a0fef (patch) | |
tree | 9ae270f6794ea381651d2a263535ee4e671b7b50 /controller-server | |
parent | 3cee15e3bee4773db524047c86e5d0d38bd2f968 (diff) | |
parent | 5b7139406a8ba7f7ba28dca5a3bee36343bf0e6c (diff) |
Merge pull request #11476 from vespa-engine/hakonhall/make-parent-host-not-ready-warning-more-user-friendly
Make parent-host-not-ready warning more user-friendly
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index a5a7f6940a3..995c257687f 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -64,14 +64,6 @@ import java.util.stream.Collectors; import static com.yahoo.config.application.api.Notifications.Role.author; import static com.yahoo.config.application.api.Notifications.When.failing; import static com.yahoo.config.application.api.Notifications.When.failingCommit; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.ACTIVATION_CONFLICT; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.APPLICATION_LOCK_FAILURE; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.BAD_REQUEST; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.CERTIFICATE_NOT_READY; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.INVALID_APPLICATION_PACKAGE; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.LOAD_BALANCER_NOT_READY; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.OUT_OF_CAPACITY; -import static com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException.ErrorCode.PARENT_HOST_NOT_READY; import static com.yahoo.vespa.hosted.controller.api.integration.configserver.Node.State.active; import static com.yahoo.vespa.hosted.controller.api.integration.configserver.Node.State.reserved; import static com.yahoo.vespa.hosted.controller.deployment.RunStatus.aborted; @@ -248,20 +240,25 @@ public class InternalStepRunner implements StepRunner { return Optional.of(running); } catch (ConfigServerException e) { - if ( e.getErrorCode() == ACTIVATION_CONFLICT - || e.getErrorCode() == APPLICATION_LOCK_FAILURE - || e.getErrorCode() == PARENT_HOST_NOT_READY - || e.getErrorCode() == CERTIFICATE_NOT_READY - || e.getErrorCode() == LOAD_BALANCER_NOT_READY) { - logger.log("Will retry, because of '" + e.getErrorCode() + "' deploying:\n" + e.getMessage()); - return Optional.empty(); - } - if ( e.getErrorCode() == INVALID_APPLICATION_PACKAGE - || e.getErrorCode() == BAD_REQUEST - || e.getErrorCode() == OUT_OF_CAPACITY) { - logger.log("Deployment failed: " + e.getMessage()); - return Optional.of(e.getErrorCode() == OUT_OF_CAPACITY ? outOfCapacity : deploymentFailed); + switch (e.getErrorCode()) { + case ACTIVATION_CONFLICT: + case APPLICATION_LOCK_FAILURE: + case CERTIFICATE_NOT_READY: + case LOAD_BALANCER_NOT_READY: + logger.log("Deployment failed with transient error " + e.getErrorCode() + ", will retry: " + e.getMessage()); + return Optional.empty(); + case PARENT_HOST_NOT_READY: + logger.log(e.getMessage()); + return Optional.empty(); + case OUT_OF_CAPACITY: + logger.log("Deployment failed: Out of capacity: " + e.getMessage()); + return Optional.of(outOfCapacity); + case INVALID_APPLICATION_PACKAGE: + case BAD_REQUEST: + logger.log("Deployment failed: " + e.getMessage()); + return Optional.of(deploymentFailed); } + throw e; } } |