Add skip lb removal flag to DeleteRequestRequest#1526
Conversation
Add a flag that can be set on the request deletion request to avoid removing the basepath associated with the service from the load balancer. The suggested use case is when the application associated with the service is moving out of Singularity, but will still be running and should remain load-balanced.
ssalinas
left a comment
There was a problem hiding this comment.
Checkbox will also need to be added to the UI
| final String deployId = getAndCheckDeployId(requestId); | ||
|
|
||
| checkConflict(!(requestManager.markAsBouncing(requestId) == SingularityCreateResult.EXISTED), "%s is already bouncing", requestId); | ||
| Optional<Boolean> removeFromLoadBalancer = Optional.absent(); |
There was a problem hiding this comment.
can probably just put Optional.absent() in the args rather than setting it here
| new SingularityRequestCleanup( | ||
| cleanupTask.getUser(), RequestCleanupType.DELETING, System.currentTimeMillis(), | ||
| Optional.of(Boolean.TRUE), requestId, Optional.<String> absent(), | ||
| Optional.of(Boolean.TRUE), Optional.absent(), requestId, Optional.<String> absent(), |
There was a problem hiding this comment.
I think we will end up losing our value in the flow here. For a delete, we end up doing something like
enqueue delete cleanup -> delete cleanup is removed and task cleanups are enqueued -> last task cleanup re-enqueues delete cleanup
The value will be there on the first delete cleanup, but we've lost it when re-enqueued (where the actual load balancer delete would happen
There was a problem hiding this comment.
yeah, it would always be absent (and then default to true it looks like) for every request. You'd prob have to add the request option configuration to the the SingularityTaskCleanup since that's the only living memory of the request so you can do something like cleanupTask.getRemoveFromLb
There was a problem hiding this comment.
👍 Missed this in the test because I forgot to actually start a task after the deploy. Will push a fix
When a request has active tasks, first the tasks are removed and the request cleanup request is destroyed. Once all the tasks are removed, then a new request cleanup request is submitted. I had missed this case, so the `removeFromLoadBalancer` flag was set on the first request, but not on the second, when it would actually take affect. This correctly propagates the `removeFromLoadBalancer` flag across both requests.
Add a flag to the remove request modal to delete the request from the load balancer.
|
👍 Let's give this one a go in staging |
Add a flag that can be set on the request deletion request to avoid
removing the basepath associated with the service from the load
balancer. The suggested use case is when the application associated with
the service is moving out of Singularity, but will still be running and
should remain load-balanced.
/cc @ssalinas