Skip to content

Commit

Permalink
Merge pull request #33066 from vespa-engine/hakonhall/avoid-stack-tra…
Browse files Browse the repository at this point in the history
…ce-when-removing-lb-after-user-has-changed-account-or-visibility

Avoid stack trace when removing LB after user has changed account or visibility
  • Loading branch information
hmusum authored Jan 2, 2025
2 parents a65fa4c + 70d92ba commit faf16b8
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,13 @@ private void prepare(LoadBalancerId id, ZoneEndpoint zoneEndpoint, NodeSpec requ
newLoadBalancer = loadBalancer.get().with(State.removable, nodeRepository.clock().instant());
throw new LoadBalancerServiceException("Could not (re)configure " + id + " due to change in load balancer visibility. The operation will be retried on next deployment");
}
newLoadBalancer = loadBalancer.orElseGet(() -> createNewLoadBalancer(id, zoneEndpoint, requested)); // Determine id-seed.
newLoadBalancer = newLoadBalancer.with(provisionInstance(newLoadBalancer, zoneEndpoint, requested)); // Update instance.
} catch (LoadBalancerServiceException e) {
log.log(Level.WARNING, "Failed to provision load balancer", e);
throw e;
try {
newLoadBalancer = loadBalancer.orElseGet(() -> createNewLoadBalancer(id, zoneEndpoint, requested)); // Determine id-seed.
newLoadBalancer = newLoadBalancer.with(provisionInstance(newLoadBalancer, zoneEndpoint, requested)); // Update instance.
} catch (LoadBalancerServiceException e) {
log.log(Level.WARNING, "Failed to provision load balancer", e);
throw e;
}
} finally {
db.writeLoadBalancer(newLoadBalancer, fromState);
}
Expand Down

0 comments on commit faf16b8

Please sign in to comment.