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 docker restart policy until the docker api stabilizes #1591

Merged
merged 1 commit into from
Oct 22, 2015

Conversation

michaelshobbs
Copy link
Member

closes #1505

josegonzalez added a commit that referenced this pull request Oct 22, 2015
…licy

remove docker restart policy until it stabilizes
@josegonzalez josegonzalez merged commit e9f7ef5 into master Oct 22, 2015
@josegonzalez josegonzalez deleted the 1505_mh-remove-auto-restart-policy branch October 22, 2015 19:19
@josegonzalez josegonzalez changed the title remove docker restart policy until it stabilizes Remove docker restart policy until the docker api stabilizes Oct 24, 2015
@ryan-bever
Copy link
Contributor

Is it time to look into the restart policy again with docker 1.9.x out? Add a new unless-stopped restart policy (#15348) was added in 1.9.0

@josegonzalez
Copy link
Member

If you want to replicate this by using the official docker-options plugin and letting us know if it worked, that would be A+.

@ryan-bever
Copy link
Contributor

Sure, I will try that out as soon as I get a chance, it will probably be a day or two.

@josegonzalez
Copy link
Member

cool :)

@ryan-bever
Copy link
Contributor

OK, I was able to test out the docker-option --restart=unless-stopped. Based on the testing that I have performed this behaves as I would desire.

Below is a summary of my testing:
I have a test-app deployed with DOKKU_SCALE=2

    dokku docker-options:add test-app deploy --restart=unless-stopped
    sudo reboot

After setting the restart option following any reboot I would see the following behavior:

  • The initial docker ps shows 4 containers up.
  • After a couple of minutes it shows only the 2 expected containers up.

docker inspect showed for both containers:

"RestartPolicy": {
            "Name": "unless-stopped",
            "MaximumRetryCount": 0
        }

After causing the app to crash (process.exit(1)) each container twice:
docker inspect showed for both containers:

"RestartCount": 2

Then sudo reboot

  • See reboot behavior description above.

Execute dokku ps:restart test-app 3 Times in quick succession:

  • docker ps Shows 8 containers up for 1-2 minutes
  • Then back down to expected 2

Then sudo reboot

  • See reboot behavior description above.

Then dokku ps:stop test-app

  • docker ps shows no containers running

Then sudo reboot

  • This time only two containers come up.
  • This is the same as doing a ps:stop and reboot with an app that does not have the restart policy.

Push new version of the test-app

  • Behaves the same as the reboot behavior description above.
  • docker inspect shows that the RestartPolicy is retained for both containers.

Test crash the test-app

  • the containers are still restarted

Then sudo reboot

  • Same reboot behavior described above

@josegonzalez
Copy link
Member

What happens on memory-constrained systems? Can you try this on a box with 512mb ram and 512mb swap?

@michaelshobbs
Copy link
Member Author

Might I suggest bringing this conversation to a new issue?

@josegonzalez
Copy link
Member

👍

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.

New containers created every reboot
3 participants