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

Allow limiting of the number of containers restarted in parallel for a scaled service #5471

Closed
wants to merge 1 commit into from

Conversation

ashmrtn
Copy link

@ashmrtn ashmrtn commented Dec 11, 2017

This patch addresses #5124 and adds a new command line flag for docker-compose up called the rollout-factor. The flag limits the number of containers that will be restarted in parallel, allowing the service to restart with zero-downtime.

@ashmrtn
Copy link
Author

ashmrtn commented Dec 11, 2017

As of now, this patch has no tests associated with it and I am not completely sure how to test it as it basically adds a command line flag and then uses pre-existing features like parallel_execute's limiter object. Do you have any suggestions as to how to test this?

aka how many containers to restart at once when updating a deployment.

Signed-off-by: Ashlie Martinez <ashmrtn@utexas.edu>
@shin-
Copy link

shin- commented Dec 12, 2017

I'm afraid that this might set up false expectations regarding the availability of the application during upgrade - there's definitely a scenario where the last container is getting restarted while the first one is still booting (i.e. not ready to receive connections). While the feature would be a nice to have, I think the implementation of it is ultimately more complex.

@ashmrtn
Copy link
Author

ashmrtn commented Dec 12, 2017

That is an excellent point that I completely neglected to think about when making this patch. From what I understand, docker-compose supported something vaguely similar when it allowed people to specify healthchecks for the condition form of depends_on. The fact that compose no longer supports that makes it feel like compose technically shouldn't support something like rolling out containers as it requires similar logic to check if a container is ready to receive requests. Do you have any thoughts on how to determine if a container is ready to receive requests that could be added to the current PR?

@ijc
Copy link

ijc commented May 21, 2019

Do you have any thoughts on how to determine if a container is ready to receive requests that could be added to the current PR?

Is the HEALTHCHECK stuff (builder docs, compose docs) useful/relevant here? IOW only consider any new container good once it has entered the Healthy state?

@glours
Copy link
Contributor

glours commented Jul 13, 2022

Thanks for taking the time to create this issue/pull request!

Unfortunately, Docker Compose V1 has reached end-of-life and we are not accepting any more changes (except for security issues). Please try and reproduce your issue with Compose V2 or rewrite your pull request to be based on the v2 branch and create a new issue or PR with the relevant Compose V2 information.

@glours glours closed this Jul 13, 2022
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.

6 participants