Add application id to IllegalArgumentException in AutoscalingMaintainer
@@ -16,6 +16,7 @@ import com.yahoo.vespa.hosted.provision.autoscale.AllocatableClusterResources;
import com.yahoo.vespa.hosted.provision.autoscale.Autoscaler;
import com.yahoo.vespa.hosted.provision.autoscale.NodeMetricSnapshot;
import com.yahoo.vespa.hosted.provision.node.History;
+import com.yahoo.yolean.Exceptions;
import java.time.Duration;
import java.time.Instant;
@@ -54,8 +55,13 @@ public class AutoscalingMaintainer extends NodeRepositoryMaintainer {
}
private void autoscale(ApplicationId application, NodeList applicationNodes) {
+ try {
nodesByCluster(applicationNodes).forEach((clusterId, clusterNodes) -> autoscale(application, clusterId, clusterNodes));
}
+ catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException("Illegal arguments for " + application + ": " + Exceptions.toMessageString(e));
+ }
+ }
private void autoscale(ApplicationId applicationId, ClusterSpec.Id clusterId, NodeList clusterNodes) {
Optional<Application> application = nodeRepository().applications().get(applicationId);
