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

Remove paused requests from LB #694

Merged
merged 10 commits into from Oct 13, 2015
Merged

Remove paused requests from LB #694

merged 10 commits into from Oct 13, 2015

Conversation

ssalinas
Copy link
Member

Now that Baragon supports the DELETE request action for a few releases, this introduces lb cleanup for paused requests. Since our current LB cleanup queue is very task based, it would be difficult to accurately determine from a task's point of view that a request could be deleted form the LB. So, I implemented a request-based lb cleanup queue to go alongside our task-based one.

@tpetr

@@ -2,6 +2,7 @@

import java.util.List;

import com.google.common.base.Optional;
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary import

return delete(getLBCleanupPath(requestId));
}

public Optional<SingularityLoadBalancerUpdate> getLoadBalancerState(String requestId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if getLoadBalancer() state is called after createLBCleanupRequest(), but no saveLoadBalancerState()?

Copy link
Member Author

Choose a reason for hiding this comment

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

From what I interpreted it would return an Optional.absent, which would tell the cleanup method that no request has been sent yet and the cleanup still needs to be started

@tpetr
Copy link
Contributor

tpetr commented Sep 21, 2015

LGTM but I'd like to get @wsorenson's 2 cents on it too

@wsorenson
Copy link
Contributor

Are there tests?

@ssalinas
Copy link
Member Author

Not yet, I can write some up today though

public SingularityLoadBalancerUpdate delete(LoadBalancerRequestId loadBalancerRequestId, SingularityRequest request, SingularityDeploy deploy) {
final List<String> serviceOwners = request.getOwners().or(Collections.<String> emptyList());
final Set<String> loadBalancerGroups = deploy.getLoadBalancerGroups().or(Collections.<String> emptySet());
final BaragonService lbService = new BaragonService(request.getId(), serviceOwners, deploy.getServiceBasePath().get(), loadBalancerGroups, deploy.getLoadBalancerOptions().orNull());
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the service not take optionals ? Seems awkward to have to transition between Optionals and empty collections here.

@wsorenson
Copy link
Contributor

What is the difference between deleting request vs deleting tasks in Baragon?

On unpause, will task additions automatically recreate what's been deleted? (I see no corresponding call)

@ssalinas
Copy link
Member Author

A DELETE for baragon removes the config completely from the load balancer. An UPDATE just adds or removes upstreams (which is what we do for tasks). If a new task is started after the service was already deleted, it will recreate everything

@wsorenson
Copy link
Contributor

So do we issue a DELETE on request removal?

@ssalinas
Copy link
Member Author

Yes, DELETE for requests removal, UPDATE for anything to do with tasks

@ssalinas
Copy link
Member Author

Added a test for the request lb cleanup queue and one small tweak for processing the cleanup

@ssalinas ssalinas added the hs_qa label Sep 28, 2015
tpetr pushed a commit that referenced this pull request Oct 13, 2015
Remove paused requests from LB
@tpetr tpetr merged commit 1b72403 into master Oct 13, 2015
@tpetr tpetr removed hs_qa labels Oct 13, 2015
@tpetr tpetr added this to the 0.4.6 milestone Oct 13, 2015
@tpetr tpetr added this to the 0.4.6 milestone Oct 13, 2015
@ssalinas ssalinas deleted the remove_paused branch December 21, 2015 16:58
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