Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Configure units to automatically restart under certain failure conditions #255

Open
wallrj opened this issue Aug 13, 2014 · 2 comments
Open

Comments

@wallrj
Copy link
Contributor

wallrj commented Aug 13, 2014

We'd like to be able to configure units to automatically restart under
certain failure conditions.

Eg

  • If a user deliberately stops the docker container associated with a
    gear unit.
  • Or if the docker container image takes so long to download that
    the systemd unit times out and enters the failed state. (although that
    may be an issue that we should address by pre-caching the docker image
    before calling gear install --start

That last problem may also be addressed by the docker readiness
notification idea in this PR
#175

The idea of recommending the systemd restart feature by default is
described here:

See:

@smarterclayton
Copy link
Contributor

Is there a max restart limit that would make sense for all containers (ie something that would be a good default)?

@wallrj
Copy link
Contributor Author

wallrj commented Aug 26, 2014

Sorry for delayed reply.

I can't see a "max restart limit" option. There's http://www.freedesktop.org/software/systemd/man/systemd.service.html#StartLimitInterval=

Supervisord sets a default maximum restart limit of 3 http://supervisord.org/configuration.html#program-x-section-settings

Twisted Procmon doesn't implement a max restart limit; it just allows you to limit the rate with a backoff algorithm. https://twistedmatrix.com/documents/current/api/twisted.runner.procmon.ProcessMonitor.html

Also worth noting that Docker (1.2.0) now has a "restart policy" feature which continues to attempt restarts indefinitely....but with a backoff:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants