diff --git a/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/LandscapeService.java b/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/LandscapeService.java index 78568e98282..622c6bb5394 100644 --- a/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/LandscapeService.java +++ b/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/LandscapeService.java @@ -288,7 +288,7 @@ public interface LandscapeService { */ Iterable>> updateImageForReplicaSets(AwsRegion region, Iterable>> replicaSets, - Optional> optionalAmi) throws InterruptedException, ExecutionException, Exception; + Optional> optionalAmi) throws InterruptedException, ExecutionException, TimeoutException; /** * For an existing replica set with an {@link AwsApplicationReplicaSet#getAutoScalingGroup() auto-scaling group} diff --git a/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/impl/LandscapeServiceImpl.java b/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/impl/LandscapeServiceImpl.java index d7d77067549..413e430484a 100644 --- a/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/impl/LandscapeServiceImpl.java +++ b/java/com.sap.sailing.landscape/src/com/sap/sailing/landscape/impl/LandscapeServiceImpl.java @@ -196,11 +196,13 @@ public class LandscapeServiceImpl implements LandscapeService { }); // if an unmanaged replica process was launched, return a replica set that contains it; otherwise use the one we already have (without any replica) return unmanagedReplica.map(ur->{ - try { - return getLandscape().getApplicationReplicaSet(region, name, master, Collections.singleton(ur)); - } catch (Exception e) { - throw new RuntimeException(e); - } + + try { + return getLandscape().getApplicationReplicaSet(region, name, master, Collections.singleton(ur)); + } catch (InterruptedException | ExecutionException | TimeoutException e) { + throw new RuntimeException(e); + } + }).orElse(result); } @@ -1237,7 +1239,7 @@ public class LandscapeServiceImpl implements LandscapeService { @Override public Iterable>> updateImageForReplicaSets(AwsRegion region, Iterable>> replicaSets, - Optional> optionalAmi) throws InterruptedException, ExecutionException, Exception { + Optional> optionalAmi) throws InterruptedException, ExecutionException, TimeoutException { final Set>> result = new HashSet<>(); for (final AwsApplicationReplicaSet> replicaSet : replicaSets) { if (replicaSet.getAutoScalingGroup() != null) { diff --git a/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/AwsLandscape.java b/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/AwsLandscape.java index be882fe5582..23261f1b1b9 100755 --- a/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/AwsLandscape.java +++ b/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/AwsLandscape.java @@ -5,6 +5,7 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.KeyPair; @@ -725,7 +726,7 @@ public interface AwsLandscape extends Landscape { > AwsApplicationReplicaSet getApplicationReplicaSet(Region region, String serverName, - ProcessT master, Iterable replicas) throws Exception; + ProcessT master, Iterable replicas) throws InterruptedException, ExecutionException, TimeoutException; CompletableFuture removeAutoScalingGroupAndLaunchConfiguration(AwsAutoScalingGroup autoScalingGroup); diff --git a/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsApplicationReplicaSetImpl.java b/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsApplicationReplicaSetImpl.java index 3154b6c561f..6fcc00a7190 100755 --- a/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsApplicationReplicaSetImpl.java +++ b/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsApplicationReplicaSetImpl.java @@ -78,7 +78,7 @@ implements AwsApplicationReplicaSet { CompletableFuture, Iterable>> allTargetGroupsInRegion, CompletableFuture>> allLoadBalancerRulesInRegion, CompletableFuture> allAutoScalingGroups, - CompletableFuture> allLaunchConfigurations, DNSCache dnsCache) throws Exception { + CompletableFuture> allLaunchConfigurations, DNSCache dnsCache) throws InterruptedException, ExecutionException, TimeoutException { super(replicaSetAndServerName, hostname, master, replicas); autoScalingGroup = new CompletableFuture<>(); defaultRedirectRule = new CompletableFuture<>(); @@ -113,7 +113,7 @@ implements AwsApplicationReplicaSet { CompletableFuture, Iterable>> allTargetGroupsInRegion, CompletableFuture>> allLoadBalancerRulesInRegion, AwsLandscape landscape, CompletableFuture> allAutoScalingGroups, - CompletableFuture> allLaunchConfigurations, DNSCache dnsCache) throws Exception { + CompletableFuture> allLaunchConfigurations, DNSCache dnsCache) throws InterruptedException, ExecutionException, TimeoutException { this(replicaSetAndServerName, /* hostname to be inferred */ null, master, replicas, allLoadBalancersInRegion, allTargetGroupsInRegion, allLoadBalancerRulesInRegion, allAutoScalingGroups, allLaunchConfigurations, dnsCache); diff --git a/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsLandscapeImpl.java b/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsLandscapeImpl.java index 5af2543f868..4c573195f78 100644 --- a/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsLandscapeImpl.java +++ b/java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsLandscapeImpl.java @@ -1513,7 +1513,7 @@ public class AwsLandscapeImpl implements AwsLandscape @Override public > AwsApplicationReplicaSet getApplicationReplicaSet(com.sap.sse.landscape.Region region, - final String serverName, final ProcessT master, final Iterable replicas) throws Exception { + final String serverName, final ProcessT master, final Iterable replicas) throws InterruptedException, ExecutionException, TimeoutException { final CompletableFuture>> allLoadBalancersInRegion = getLoadBalancersAsync(region); final CompletableFuture, Iterable>> allTargetGroupsInRegion = getTargetGroupsAsync(region); final CompletableFuture>> allLoadBalancerRulesInRegion = getLoadBalancerListenerRulesAsync(region, allLoadBalancersInRegion); @@ -1531,7 +1531,7 @@ public class AwsLandscapeImpl implements AwsLandscape final CompletableFuture, Iterable>> allTargetGroupsInRegion, final CompletableFuture>> allLoadBalancerRulesInRegion, final CompletableFuture> allAutoScalingGroups, - CompletableFuture> allLaunchConfigurations, final DNSCache dnsCache) throws Exception { + CompletableFuture> allLaunchConfigurations, final DNSCache dnsCache) throws InterruptedException, ExecutionException, TimeoutException { final AwsApplicationReplicaSet replicaSet = new AwsApplicationReplicaSetImpl( serverName, master, Optional.ofNullable(replicas), allLoadBalancersInRegion, allTargetGroupsInRegion, allLoadBalancerRulesInRegion, this, allAutoScalingGroups, allLaunchConfigurations, dnsCache);