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

Conversation

Projects
None yet
3 participants
@ssalinas
Member

ssalinas commented Sep 17, 2015

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

@ssalinas ssalinas added the hs_staging label Sep 18, 2015

Show outdated Hide outdated ...vice/src/main/java/com/hubspot/singularity/hooks/LoadBalancerClient.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.google.common.base.Optional;

This comment has been minimized.

@tpetr

tpetr Sep 21, 2015

Member

unnecessary import

@tpetr

tpetr Sep 21, 2015

Member

unnecessary import

return delete(getLBCleanupPath(requestId));
}
public Optional<SingularityLoadBalancerUpdate> getLoadBalancerState(String requestId) {

This comment has been minimized.

@tpetr

tpetr Sep 21, 2015

Member

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

@tpetr

tpetr Sep 21, 2015

Member

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

This comment has been minimized.

@ssalinas

ssalinas Sep 21, 2015

Member

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

@ssalinas

ssalinas Sep 21, 2015

Member

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

This comment has been minimized.

Show comment
Hide comment
@tpetr

tpetr Sep 21, 2015

Member

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

Member

tpetr commented Sep 21, 2015

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

@wsorenson

This comment has been minimized.

Show comment
Hide comment
@wsorenson

wsorenson Sep 21, 2015

Member

Are there tests?

Member

wsorenson commented Sep 21, 2015

Are there tests?

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Sep 21, 2015

Member

Not yet, I can write some up today though

Member

ssalinas commented Sep 21, 2015

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());

This comment has been minimized.

@wsorenson

wsorenson Sep 21, 2015

Member

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

@wsorenson

wsorenson Sep 21, 2015

Member

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

@wsorenson

This comment has been minimized.

Show comment
Hide comment
@wsorenson

wsorenson Sep 21, 2015

Member

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)

Member

wsorenson commented Sep 21, 2015

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

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Sep 21, 2015

Member

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

Member

ssalinas commented Sep 21, 2015

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

This comment has been minimized.

Show comment
Hide comment
@wsorenson

wsorenson Sep 21, 2015

Member

So do we issue a DELETE on request removal?

Member

wsorenson commented Sep 21, 2015

So do we issue a DELETE on request removal?

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Sep 21, 2015

Member

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

Member

ssalinas commented Sep 21, 2015

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

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Sep 21, 2015

Member

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

Member

ssalinas commented Sep 21, 2015

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

ssalinas added some commits Oct 7, 2015

@ssalinas ssalinas added the hs_stable label Oct 8, 2015

tpetr added a commit that referenced this pull request Oct 13, 2015

Merge pull request #694 from HubSpot/remove_paused
Remove paused requests from LB

@tpetr tpetr merged commit 1b72403 into master Oct 13, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@tpetr tpetr modified the milestone: 0.4.6 Oct 13, 2015

@ssalinas ssalinas deleted the remove_paused branch Dec 21, 2015

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