Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Bug: in-memory v.connections value lost when it crashes and restarted #14

Closed
ghostplant opened this issue Feb 9, 2017 · 9 comments
Closed

Comments

@ghostplant
Copy link

When multi-containers share volume of same name, crash of plugin driver will be unable to correctly handle their umount once it is restarted.

@vieux
Copy link
Owner

vieux commented Feb 9, 2017

@ghostplant I'll look into it, any hints on why the plugin crashed ?

@vieux
Copy link
Owner

vieux commented Feb 10, 2017

@ghostplant I believe it's fixed by fe8b54f

@ghostplant
Copy link
Author

ghostplant commented Feb 10, 2017

@vieux
No, Volume.Umount is solved but it causes another bug from Volume.Remove:
docker volume rm sshvolume
Error response from daemon: Error while removing volume sshvolume: remove sshvolume: VolumeDriver.Remove: volume sshvolume is currently used by a container

Actually, no containers exist.

@ghostplant
Copy link
Author

ghostplant commented Feb 10, 2017

I think API should contain req.{Name, ID, nameIsShared:bool}. Thus it will simplify implementation for most of 3rd-party plugin driver and no longer has any kinds of counter bugs.

As you can see, over 30% code is extended to focus on how to persist stateful data while it still not fixes this issue. All mount-based plugin driver implementations also need such complex handling.

@ghostplant
Copy link
Author

ghostplant commented Feb 10, 2017

Case 1:
$ docker volume plugin install vieux/sshfs
$ docker volume create -d vieux/sshfs -o sshcmd=a@0.0.0.0:/tmp -o password=123 sshvolume
$ docker run -it --name n1 -d -v sshvolume:/ssh alpine:3.4 sleep 1h
$ killall docker-volume-sshfs
$ docker volume rm sshvolume
Error response from daemon: Unable to remove volume, volume still in use: remove sshvolume: volume is in use - [2f56f17a3bba9a2f1ed72ae3db495e2417b1219ec17a4b324445e3c481551209]
$ docker kill n1 && docker rm n1
$ docker volume rm sshvolume
Error response from daemon: Error while removing volume sshvolume: remove sshvolume: VolumeDriver.Remove: remove /mnt/volumes/59faf0aa8522fecd92fd6a1af9c91230: device or resource busy

@ghostplant
Copy link
Author

ghostplant commented Feb 10, 2017

Case 2:
$ docker volume plugin install vieux/sshfs
$ docker volume create -d vieux/sshfs -o sshcmd=a@0.0.0.0:/tmp -o password=123 sshvolume
$ docker run -it --name n1 -d -v sshvolume:/ssh alpine:3.4 sleep 1h
$ docker run -it --name n2 -d -v sshvolume:/ssh alpine:3.4 sleep 1h
$ killall docker-volume-sshfs
$ docker kill n1 && docker rm n1
$ docker kill n2 && docker rm n2
$ docker volume rm sshvolume
Error response from daemon: Error while removing volume sshvolume: remove sshvolume: VolumeDriver.Remove: volume sshvolume is currently used by a container

@vieux
Copy link
Owner

vieux commented Feb 10, 2017

@ghostplant the old usecase where you have docker-volume-sshfs isn't supported anymore.
Can you try with 1.13 and the new style plugins ?

@ghostplant
Copy link
Author

ghostplant commented Feb 11, 2017

@vieux
I certainly did the test on Docker 1.13. See both Case 1 & Case 2 contain docker volume plugin xxx which is unsupported before 1.13.

Note that there are many ways to crash a plugin driver which runs inside a docker container.
Externally executing kill docker-volume-sshfs is just one approach to break docker-volume-sshfs inside a container down.

@vieux
Copy link
Owner

vieux commented Aug 18, 2017

I believe this issues was fixed in 1.0 the state is now saved on disk.

@vieux vieux closed this as completed Aug 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants