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

Only destroy load balancers when the app is destroyed. #801

Merged
merged 2 commits into from
Apr 28, 2016

Conversation

ejholmes
Copy link
Contributor

Fixes #798

I think it's a lot safer if we only ever destroy a load balancer when the entire app is destroyed, rather than per process. With the existing behavior, it would be possible to deploy a Procfile without the web process and the load balancer would be destroyed, making it more difficult to recover from (if you have CNAME's pointed at it).

With the new behavior, it does mean that you could potentially accumulate unused load balancers, but those can always be destroyed manually if it's a real problem.

@@ -527,16 +527,18 @@ func (m *Scheduler) loadBalancer(ctx context.Context, app *scheduler.App, p *sch
return l, nil
}

func (m *Scheduler) removeLoadBalancer(ctx context.Context, app string, p string) error {
l, err := m.findLoadBalancer(ctx, app, p)
func (m *Scheduler) removeLoadBalancers(ctx context.Context, app string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this called somewhere else before? I'm not sure how this stops the previous behavior - only that it adds the behavior that it will now make sure that the LBs are destroyed when Remove is called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, Remove is called when the entire app is destroyed. Previously, this was in RemoveProcess, which is called to remove an individual process in the app (say for example, you had a worker1 process, but then you changed its name to worker, we remove the irrelevant ecs service).

@ejholmes ejholmes merged commit 644f468 into master Apr 28, 2016
@ejholmes ejholmes deleted the no-elb-destroy branch April 28, 2016 00:07
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

2 participants