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

Need way to limit exponential container restart delay #41856

Open
macdjord opened this issue Jan 5, 2021 · 0 comments
Open

Need way to limit exponential container restart delay #41856

macdjord opened this issue Jan 5, 2021 · 0 comments
Labels
kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@macdjord
Copy link

macdjord commented Jan 5, 2021

When a container with a restart policy fails repeatedly, Docker imposes an exponentially increasing delay between restart attempts. This is, in general, useful, since it prevents a container which cannot start successfully from overloading the system. However, there is currently no way to limit how large this delay can grow.

The particular case I am dealing with is a container which depends on a particular system being in a ready state before it can start up, and exits if it is not. Given it is relatively cheap to start the container and check the state, I would like it to try no less than once every 10s. As-is, if the system is down, the restart delay can grow to an absurd length.

Things Which Will Not Work

  • 'Use container dependencies'
    • The system which the container needs to wait on is not itself a container.
  • 'Move the check-wait-recheck loop inside the container'
    • This results in the container being 'up' when it is not, in fact, in operation condition
  • 'Docker swarm has this option called 'restart_policy'...'
    • I am not using Swarm. This functionality should be in base docker.

Other Things Which Would Be Nice To Be Able To Adjust

  • The minimum delay at which the exponential backoff starts
  • The amount of time the container must be up in order to count as 'successful' and reset the backoff timer
  • Whether a run of the container which lasts longer than the required time but exits with a nonzero code should count as 'successful' at all (or conversely, whether a run which doesn't last that long but exits with code 0 should count as 'successful' automatically)
@thaJeztah thaJeztah added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests

2 participants