lucaslorentz / caddy-supervisor

Run and supervise background processes from Caddy
MIT License
33 stars 13 forks source link

Self healing #4

Closed ShalokShalom closed 6 years ago

ShalokShalom commented 6 years ago

Has this self healing support?

lucaslorentz commented 6 years ago

No. It can heal the processes it launches and supervise. But if caddy itself crashes, it doesn't heal itself.

Maybe if you install caddy as a service you can setup it to be restarted after crash. Check the caddy service plugin, maybe it supports that: https://github.com/hacdias/caddy-service

Does that answer your question? If no, please, give me more details.

ShalokShalom commented 6 years ago

Partly. How does it heal the processes it launches? Automatically?

lucaslorentz commented 6 years ago

If the running process exits, the supervisor starts it again after 10 seconds, based on the setting restart_policy:

If after restarting the process, it exits again in less than 10 minutes, supervisor considers it unstable and increase it's restart delay to 20 seconds, if it fails again it increases to 40, and so forth. Whenever it runs for 10 minutes, the restart delay is reset to 10 seconds.

ShalokShalom commented 6 years ago

So every software that I put on Caddy can provide the same self healing capabilities as Erlang's VM?

lucaslorentz commented 6 years ago

Sorry, but I don't know how Erlang's VM healing works, so I can't compare.

ShalokShalom commented 6 years ago

I see, thanks a lot.

I think this feature is worth mentioning in your README anyways.

Good job :D