{"action":"created","issue":{"url":"https://api.github.com/repos/ContainX/docker-volume-netshare/issues/163","repository_url":"https://api.github.com/repos/ContainX/docker-volume-netshare","labels_url":"https://api.github.com/repos/ContainX/docker-volume-netshare/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/ContainX/docker-volume-netshare/issues/163/comments","events_url":"https://api.github.com/repos/ContainX/docker-volume-netshare/issues/163/events","html_url":"https://github.com/ContainX/docker-volume-netshare/pull/163","id":323471725,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4MzIxMDIw","number":163,"title":"Added states for docker-volume-netshare.","user":{"login":"jakirpatel","id":31799856,"node_id":"MDQ6VXNlcjMxNzk5ODU2","avatar_url":"https://avatars1.githubusercontent.com/u/31799856?v=4","gravatar_id":"","url":"https://api.github.com/users/jakirpatel","html_url":"https://github.com/jakirpatel","followers_url":"https://api.github.com/users/jakirpatel/followers","following_url":"https://api.github.com/users/jakirpatel/following{/other_user}","gists_url":"https://api.github.com/users/jakirpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/jakirpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakirpatel/subscriptions","organizations_url":"https://api.github.com/users/jakirpatel/orgs","repos_url":"https://api.github.com/users/jakirpatel/repos","events_url":"https://api.github.com/users/jakirpatel/events{/privacy}","received_events_url":"https://api.github.com/users/jakirpatel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-16T05:16:47Z","updated_at":"2018-06-12T08:59:50Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ContainX/docker-volume-netshare/pulls/163","html_url":"https://github.com/ContainX/docker-volume-netshare/pull/163","diff_url":"https://github.com/ContainX/docker-volume-netshare/pull/163.diff","patch_url":"https://github.com/ContainX/docker-volume-netshare/pull/163.patch"},"body":"Hello , \r\n\r\nI am sending this pull request for significant change in plugin architecture. This PR will solve two major issues:\r\n\r\n1. States of the volumes: \r\n\r\nIf the plugin restarts then the previous version of plugin was not able to handle the state. The states of docker daemon and plugin were inconsistent. As I can see the few comments in issue either we can maintain the persistent storage to handle this or at the start of plugin we can let the plugin knows that the states are not consistent.\r\n\r\nWhat I did here?\r\nBefore the plugin initialize all its component like volume driver etc. I am calling the docker daemon and getting the details about volumes. That I call _activeConnections_. \r\n\r\nTo know all these states present I initialized the MountManager and added the states into the memory of plugin. \r\n\r\n\r\n2.NFS inconsistent connections: \r\nWhile testing I observed if I remount the volume the connections were not increased. Also if you forcefully umount the volume and start container with same mount then previous version of plugin was increasing the number of connections with mount by 2. \r\n\r\nThat was the reason of unsual behaviour of unmounting the mounts. Also due to plugin is acting as the proxy and in mentioned scenario it is still assuming the connections are still there. It goes into inconsistent state. \r\n\r\nThis inconsistent connections leads problem with removal of docker volume. The current PR is solving this issue. \r\nAlso it is necessary to know docker perspective that docker will also assume the stopped containers using the volume. \r\n\r\nBefore the deleting plugin must check active connections and also references with stopped containers. If both are zero then it will be able to delete the volume. \r\n\r\n\r\nAs I am using the Docker Go Client, I introduced new flag to plugin for maintaining the version compatibility for the plugin. \r\n\r\nThis flag will set the DOCKER_API_VERSION which is required for Go client. By default it will use the lastest stable version. Currently it is 1.37.\r\n \r\nPlease review it. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ContainX/docker-volume-netshare/issues/comments/396518203","html_url":"https://github.com/ContainX/docker-volume-netshare/pull/163#issuecomment-396518203","issue_url":"https://api.github.com/repos/ContainX/docker-volume-netshare/issues/163","id":396518203,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjUxODIwMw==","user":{"login":"jakirpatel","id":31799856,"node_id":"MDQ6VXNlcjMxNzk5ODU2","avatar_url":"https://avatars1.githubusercontent.com/u/31799856?v=4","gravatar_id":"","url":"https://api.github.com/users/jakirpatel","html_url":"https://github.com/jakirpatel","followers_url":"https://api.github.com/users/jakirpatel/followers","following_url":"https://api.github.com/users/jakirpatel/following{/other_user}","gists_url":"https://api.github.com/users/jakirpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/jakirpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakirpatel/subscriptions","organizations_url":"https://api.github.com/users/jakirpatel/orgs","repos_url":"https://api.github.com/users/jakirpatel/repos","events_url":"https://api.github.com/users/jakirpatel/events{/privacy}","received_events_url":"https://api.github.com/users/jakirpatel/received_events","type":"User","site_admin":false},"created_at":"2018-06-12T08:59:50Z","updated_at":"2018-06-12T08:59:50Z","author_association":"NONE","body":"@gondor This is the major change in terms of architecture perspective. I have tested it, But to make sure it will be really helpful if you have little time to perform the tests on all drivers. If you think there might be any suggestion or change required let me know as well. \r\n\r\n\r\nI have fully tested it on NFS driver (in all scenarios). There are no major changes in other drivers. "}}
{"actor":{"display_login":"jakirpatel"}}