TritonDataCenter / containerpilot

A service for autodiscovery and configuration of applications running in containers
Mozilla Public License 2.0
1.13k stars 136 forks source link

restart delay #396

Open untoreh opened 7 years ago

untoreh commented 7 years ago

How can you make a service restart after a delay? I read an old issue excluding backoffs behaviour, is it the same for v3? Apart from exec with sleep; ... a delay can't be achieved by chaining jobs because a job can only have 1 source or even when statement. Is it something like "restarts": "10s" going to be implemented in v3?

tgross commented 7 years ago

How can you make a service restart after a delay? I read an old issue excluding backoffs behaviour, is it the same for v3?

This can't be done currently in v3. I'm not sure which issue you mean... I searched but wasn't able to find that. Got a link?

Is it something like "restarts": "10s" going to be implemented in v3?

I wasn't planning on it but it doesn't seem impossible to do. What's the use case you had in mind? The restarts field is currently a count of the allowed restarts, so what would you propose as the syntax?

untoreh commented 7 years ago

Got a link?

this one about co processes #175

What's the use case you had in mind?

well it only makes sense when running multiple "tier 1" processes, to avoid bringing down the rest, whereas when running only one main proc stopping ancillary processes is not taxing, so restarts policies can be applied on top of containerpilot

what would you propose as the syntax?

something like structure with interval time notation, limit int max restarts, and increment time to be added on each consecutive restart

tgross commented 7 years ago

this one about co processes #175

Thanks. Seeing that and your comment here though...

well it only makes sense when running multiple "tier 1" processes, to avoid bringing down the rest, whereas when running only one main proc stopping ancillary processes is not taxing, so restarts policies can be applied on top of containerpilot

Just so that I understand, it sounds like you're saying that you're worried about a service that's continuously crashing in this scenario? That's why we put the restarts fields in, so that we can just say "this definitely isn't working so let's bail out".

tgross commented 7 years ago

Noting for myself that there's a lot of under-the-hook implementation overlap between the issues in #435, #416, and #396