yp-engineering / rbd-docker-plugin

Ceph RBD docker volume driver plugin.
MIT License
102 stars 70 forks source link

stop/restart docker daemon with running containers #32

Open msuringa opened 8 years ago

msuringa commented 8 years ago

When I restart the docker daemon which has containers running that use this volume driver, the running containers get stopped/killed, but the all mounts remain locked. Is this something the volume plugin can resolve, or is this handled in the docker daemon process?

porcupie commented 8 years ago

I'll have to look into this - I would think that docker daemon would send the proper command to the volume plugin when terminating any running containers. If daemon gets killed and can't cleanup, then I might expect to need to do some manual cleanups.

What version of docker ? What OS? Is it a clean shutdown or an unexpected termination?

msuringa commented 8 years ago

OS is RedHat 7.2 Docker version: 1.9.1 I see this behaviour when I do a clean restart/stop of the docker daemon.

I have resolved this issue locally by adding some logic to check if the image that's being mounted has watchers anywhere, if it doesn't, it will cancel whatever lock is in place and lock it for the local server.