watchtower icon indicating copy to clipboard operation
watchtower copied to clipboard

fix: gracefully stop containers (#237)

Open anthonyvallone opened this issue 2 years ago • 8 comments

  • updated docker to v23.0.1+incompatible closes #237

anthonyvallone avatar Feb 16 '23 20:02 anthonyvallone

Is there anything holding this back?

maleadt avatar Jun 15 '23 08:06 maleadt

It has conflicts, but I think the main problem is that I have no idea what this PR is trying to do. It just looks like it would do a worse job at gracefully stopping containers.

piksel avatar Jun 15 '23 11:06 piksel

Why would it be worse? ContainerStop does graceful termination, falling back to SIGKILL: https://github.com/moby/moby/blob/d2e7a6e799c98815f0b163d16ee14f8359700c39/daemon/stop.go#L23. Admittedly, I'm not sure what the difference between ContainerStop and ContainerKill is if you specify a signal, but I guess it's similar to docker stop vs docker kill where the former seems to be the recommended option for graceful termination.

maleadt avatar Jun 15 '23 12:06 maleadt

It's worse because it doesn't use the container-specified signal, sends a kill signal if it doesn't respond, but doesn't wait for the container to stop. The removal of the container that is done after the stopping (with force which kills the container if it's running) should result in the same behaviour as the container stop. Hence why I don't think this solves anything (and it's hard to actually test).

piksel avatar Jun 15 '23 15:06 piksel

I'm getting notifications on my Synology box about this. I'm curious if there's an ETA for this PR landing.

gfairchild avatar Aug 28 '23 03:08 gfairchild

I've been waiting for this fix ever since I bought my NAS but have only now got annoyed enough with the notifications to look. Other than the potential risk of a 3 major release jump in the docker CLI.. I see no risk in the changes.

What is this PR waiting for? Is there something that can be done to help it get merged?

I am also interested in helping move this forward.

Tailslide avatar Apr 13 '24 01:04 Tailslide

I just started using Watchtower and would love this to avoid the erroneous messages from Synology about unexpected container stops.

jabib avatar Apr 29 '24 12:04 jabib