diff options
3 files changed, 14 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java index a91a7949ad8..9072b5d9cfe 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java @@ -73,7 +73,6 @@ public class DomAdminV4Builder extends DomAdminBuilderBase { private void assignLogserver(DeployState deployState, NodesSpecification nodesSpecification, Admin admin) { if (nodesSpecification.minResources().nodes() > 1) throw new IllegalArgumentException("You can only request a single log server"); - if (deployState.getProperties().applicationId().instance().isTester()) return; // No logserver is needed on tester applications if (nodesSpecification.isDedicated()) { Collection<HostResource> hosts = allocateHosts(admin.hostSystem(), "logserver", nodesSpecification); if (hosts.isEmpty()) return; // No log server can be created (and none is needed) @@ -92,9 +91,10 @@ public class DomAdminV4Builder extends DomAdminBuilderBase { private NodesSpecification createNodesSpecificationForLogserver() { DeployState deployState = context.getDeployState(); - if (deployState.getProperties().useDedicatedNodeForLogserver() && - context.getApplicationType() == ConfigModelContext.ApplicationType.DEFAULT && - deployState.isHosted()) + if ( deployState.getProperties().useDedicatedNodeForLogserver() + && context.getApplicationType() == ConfigModelContext.ApplicationType.DEFAULT + && deployState.isHosted() + && ! deployState.getProperties().applicationId().instance().isTester()) return NodesSpecification.dedicated(1, context); else return NodesSpecification.nonDedicated(1, context); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java index 5fd1e8347ef..3ed5854327b 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/JobRunnerTest.java @@ -106,12 +106,16 @@ public class JobRunnerTest { assertFalse(jobs.last(id, systemTest).get().hasEnded()); assertTrue(jobs.last(id, stagingTest).get().stepStatuses().values().stream().allMatch(unfinished::equals)); assertFalse(jobs.last(id, stagingTest).get().hasEnded()); - runner.maintain(); + runner.maintain(); phaser.arriveAndAwaitAdvance(); assertTrue(jobs.last(id, systemTest).get().stepStatuses().values().stream().allMatch(succeeded::equals)); - assertTrue(jobs.last(id, stagingTest).get().hasEnded()); assertTrue(jobs.last(id, stagingTest).get().hasFailed()); + + runner.maintain(); + phaser.arriveAndAwaitAdvance(); + assertTrue(jobs.last(id, systemTest).get().hasEnded()); + assertTrue(jobs.last(id, stagingTest).get().hasEnded()); } @Test @@ -442,8 +446,8 @@ public class JobRunnerTest { @Override public void execute(Runnable command) { phaser.register(); delegate.execute(() -> { - command.run(); - phaser.arriveAndDeregister(); + try { command.run(); } + finally { phaser.arriveAndDeregister(); } }); } }; diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/api/VespaCurator.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/api/VespaCurator.java index dc717f6d65d..32aef2da118 100644 --- a/zkfacade/src/main/java/com/yahoo/vespa/curator/api/VespaCurator.java +++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/api/VespaCurator.java @@ -1,6 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.curator.api; +import com.yahoo.concurrent.UncheckedTimeoutException; import com.yahoo.path.Path; import java.time.Duration; @@ -14,6 +15,6 @@ import java.time.Duration; public interface VespaCurator { /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */ - AutoCloseable lock(Path path, Duration timeout); + AutoCloseable lock(Path path, Duration timeout) throws UncheckedTimeoutException; } |