New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip lb removal flag to DeleteRequestRequest #1526

Merged
merged 4 commits into from May 31, 2017

Conversation

Projects
None yet
3 participants
@PtrTeixeira
Contributor

PtrTeixeira commented May 4, 2017

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

Add skip lb removal flag to DeleteRequestRequest
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

Checkbox will also need to be added to the UI

Show outdated Hide outdated ...ice/src/main/java/com/hubspot/singularity/resources/RequestResource.java
@@ -235,10 +235,11 @@ public SingularityRequestParent bounce(String requestId, Optional<SingularityBou
final String deployId = getAndCheckDeployId(requestId);
checkConflict(!(requestManager.markAsBouncing(requestId) == SingularityCreateResult.EXISTED), "%s is already bouncing", requestId);
Optional<Boolean> removeFromLoadBalancer = Optional.absent();

This comment has been minimized.

@ssalinas

ssalinas May 4, 2017

Member

can probably just put Optional.absent() in the args rather than setting it here

@ssalinas

ssalinas May 4, 2017

Member

can probably just put Optional.absent() in the args rather than setting it here

Show outdated Hide outdated .../src/main/java/com/hubspot/singularity/scheduler/SingularityCleaner.java
@@ -659,7 +661,7 @@ private void cleanupRequestIfNoRemainingTasks(SingularityTaskCleanup cleanupTask
requestManager.createCleanupRequest(
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(),

This comment has been minimized.

@ssalinas

ssalinas May 4, 2017

Member

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

@ssalinas

ssalinas May 4, 2017

Member

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

This comment has been minimized.

@darcatron

darcatron May 4, 2017

Contributor

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

@darcatron

darcatron May 4, 2017

Contributor

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

This comment has been minimized.

@PtrTeixeira

PtrTeixeira May 5, 2017

Contributor

👍 Missed this in the test because I forgot to actually start a task after the deploy. Will push a fix

@PtrTeixeira

PtrTeixeira May 5, 2017

Contributor

👍 Missed this in the test because I forgot to actually start a task after the deploy. Will push a fix

PtrTeixeira added some commits May 5, 2017

Correctly propagate remove request
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 flag to remove modal to delete from lb
Add a flag to the remove request modal to delete the request from the
load balancer.

@ssalinas ssalinas modified the milestone: 0.16.0 May 10, 2017

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas May 11, 2017

Member

👍 Let's give this one a go in staging

Member

ssalinas commented May 11, 2017

👍 Let's give this one a go in staging

@ssalinas ssalinas merged commit a5c26dd into master May 31, 2017

@ssalinas ssalinas deleted the skip-lb-delete branch May 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment