Wowu / docker-rollout

🚀 Zero Downtime Deployment for Docker Compose
https://github.com/Wowu/docker-rollout
MIT License
2.18k stars 59 forks source link

Feature: Add additional wait after containers are healthy #27

Closed benzht closed 3 months ago

benzht commented 3 months ago

I am having issues with some images that report 'ready' slightly before they are actually ready to do real business. One in particular would need just another few seconds to finish its infinispan-syncronisation (i.e., it is ready to sync, but not with the sync).

My proposal would be to define a switch like -g | --graceperiod SECONDS with default 0 and insert a suitable wait als else branch of this if [ "$SUCCESS" != "$SCALE" ]; then.

I can create a PR if that is desired.

Best regards

Wowu commented 3 months ago

I wonder what's the recommended way of configuring zero downtime deployment for your service, maybe it was designed for environments supporting multiple healthchecks like Kubernetes.

Anyway, contributions are always welcome 😃 I believe this is probably a niche use case so I wouldn't reserve a single letter flag for this. What do you think about --healthcheck-grace-period SECONDS? Or --wait-after-healthy SECONDS so it's similar to --wait SECONDS.

benzht commented 3 months ago

The root of my problem appears to be traefik doing it's own health checks and only a single container instance running. When docker-rollout detects the new container 'healthy', but traefik still needs to detect it, then killing the old container will lead to disruption of service. Please expect a PR (going for --wait-after-healthy)...

Wowu commented 3 months ago

Implemented in #28

Wowu commented 3 months ago

Released in https://github.com/Wowu/docker-rollout/releases/tag/v0.9