Skip to content
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
Merged

Conversation

PtrTeixeira
Copy link
Contributor

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 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.
Copy link
Member

@ssalinas ssalinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox will also need to be added to the UI

@@ -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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@@ -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(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 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.
@ssalinas ssalinas modified the milestone: 0.16.0 May 10, 2017
@ssalinas
Copy link
Member

👍 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 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants