{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/50536601","id":50536601,"diff_hunk":"@@ -309,37 +324,65 @@ func (c *cinderVolumeCleaner) TearDown() error {\n // Unmounts the bind mount, and detaches the disk only if the PD\n // resource was the last reference to that disk on the kubelet.\n func (c *cinderVolumeCleaner) TearDownAt(dir string) error {\n+\tglog.V(5).Infof(\"Cinder TearDown of %s\", dir)\n \tnotmnt, err := c.mounter.IsLikelyNotMountPoint(dir)\n \tif err != nil {\n+\t\tglog.V(4).Infof(\"IsLikelyNotMountPoint check failed: %v\", err)\n \t\treturn err\n \t}\n \tif notmnt {\n+\t\tglog.V(4).Infof(\"Nothing is mounted to %s, ignoring\", dir)\n \t\treturn os.Remove(dir)\n \t}\n+\n+\t// Find Cinder volumeID to lock the right volume\n+\t// TODO: refactor VolumePlugin.NewCleaner to get full volume.Spec just like\n+\t// NewBuilder. We could then find volumeID there without probing MountRefs.","path":"pkg/volume/cinder/cinder.go","position":101,"original_position":101,"commit_id":"2c95117f05ad582a0e4f99f998ae91f0ae859c5e","original_commit_id":"2c95117f05ad582a0e4f99f998ae91f0ae859c5e","user":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"body":"I think kubelet has whole VolumeSpec available when it creates cleaners, so it's fairly simple change. On the other hand, all the volume plugins needs to be updated with new `NewCleaner` signature.","created_at":"2016-01-22T13:34:57Z","updated_at":"2016-01-22T13:34:57Z","html_url":"https://github.com/kubernetes/kubernetes/pull/19707#discussion_r50536601","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/50536601"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/19707#discussion_r50536601"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707","id":56203020,"html_url":"https://github.com/kubernetes/kubernetes/pull/19707","diff_url":"https://github.com/kubernetes/kubernetes/pull/19707.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/19707.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/19707","number":19707,"state":"open","locked":false,"title":"Fix race condition in cinder attach/detach","user":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"body":"Resolves https://github.com/kubernetes/kubernetes/issues/19602\r\n\r\nMost of the changes are related to unit test. The real fix is in cinder.go. Similar change is needed in most of the volume plugins! Cinder seems to be the easiest to reproduce in real world, as it's the slowest to attach volumes (and thus the window of opportunity is the largest).\r\n\r\nAlso, I added some logs here and there to debug this issue easily next time.","created_at":"2016-01-15T18:19:00Z","updated_at":"2016-01-22T13:34:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"166c1031236e54b062854a60f3a20c6fc6c2aa68","assignee":{"login":"saad-ali","id":10052848,"avatar_url":"https://avatars.githubusercontent.com/u/10052848?v=3","gravatar_id":"","url":"https://api.github.com/users/saad-ali","html_url":"https://github.com/saad-ali","followers_url":"https://api.github.com/users/saad-ali/followers","following_url":"https://api.github.com/users/saad-ali/following{/other_user}","gists_url":"https://api.github.com/users/saad-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/saad-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saad-ali/subscriptions","organizations_url":"https://api.github.com/users/saad-ali/orgs","repos_url":"https://api.github.com/users/saad-ali/repos","events_url":"https://api.github.com/users/saad-ali/events{/privacy}","received_events_url":"https://api.github.com/users/saad-ali/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/19707/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2c95117f05ad582a0e4f99f998ae91f0ae859c5e","head":{"label":"jsafrane:devel/fix-cinder-teardown","ref":"devel/fix-cinder-teardown","sha":"2c95117f05ad582a0e4f99f998ae91f0ae859c5e","user":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"repo":{"id":33241093,"name":"kubernetes","full_name":"jsafrane/kubernetes","owner":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jsafrane/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/jsafrane/kubernetes","forks_url":"https://api.github.com/repos/jsafrane/kubernetes/forks","keys_url":"https://api.github.com/repos/jsafrane/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsafrane/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsafrane/kubernetes/teams","hooks_url":"https://api.github.com/repos/jsafrane/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jsafrane/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jsafrane/kubernetes/events","assignees_url":"https://api.github.com/repos/jsafrane/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jsafrane/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jsafrane/kubernetes/tags","blobs_url":"https://api.github.com/repos/jsafrane/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsafrane/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsafrane/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsafrane/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsafrane/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jsafrane/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jsafrane/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jsafrane/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jsafrane/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jsafrane/kubernetes/subscription","commits_url":"https://api.github.com/repos/jsafrane/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsafrane/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsafrane/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsafrane/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsafrane/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jsafrane/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsafrane/kubernetes/merges","archive_url":"https://api.github.com/repos/jsafrane/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsafrane/kubernetes/downloads","issues_url":"https://api.github.com/repos/jsafrane/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jsafrane/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jsafrane/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jsafrane/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsafrane/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jsafrane/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/jsafrane/kubernetes/deployments","created_at":"2015-04-01T10:16:41Z","updated_at":"2016-01-15T18:08:52Z","pushed_at":"2016-01-22T12:54:15Z","git_url":"git://github.com/jsafrane/kubernetes.git","ssh_url":"git@github.com:jsafrane/kubernetes.git","clone_url":"https://github.com/jsafrane/kubernetes.git","svn_url":"https://github.com/jsafrane/kubernetes","homepage":"http://kubernetes.io","size":148533,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"83a6b7fcaa2869744c7929b0c9b568168df60a10","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-01-22T13:23:10Z","pushed_at":"2016-01-22T13:11:02Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":308706,"stargazers_count":12287,"watchers_count":12287,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3460,"mirror_url":null,"open_issues_count":2820,"forks":3460,"open_issues":2820,"watchers":12287,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/19707"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/19707"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/19707/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19707/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2c95117f05ad582a0e4f99f998ae91f0ae859c5e"}}}}