{"action":"created","issue":{"url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/1040","repository_url":"https://api.github.com/repos/vmware/docker-volume-vsphere","labels_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/1040/labels{/name}","comments_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/1040/comments","events_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/1040/events","html_url":"https://github.com/vmware/docker-volume-vsphere/pull/1040","id":214705089,"number":1040,"title":"Use a longer delay in case the short timeout is insufficient for device attach","user":{"login":"govint","id":15854712,"avatar_url":"https://avatars0.githubusercontent.com/u/15854712?v=3","gravatar_id":"","url":"https://api.github.com/users/govint","html_url":"https://github.com/govint","followers_url":"https://api.github.com/users/govint/followers","following_url":"https://api.github.com/users/govint/following{/other_user}","gists_url":"https://api.github.com/users/govint/gists{/gist_id}","starred_url":"https://api.github.com/users/govint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/govint/subscriptions","organizations_url":"https://api.github.com/users/govint/orgs","repos_url":"https://api.github.com/users/govint/repos","events_url":"https://api.github.com/users/govint/events{/privacy}","received_events_url":"https://api.github.com/users/govint/received_events","type":"User","site_admin":false},"labels":[{"id":357052365,"url":"https://api.github.com/repos/vmware/docker-volume-vsphere/labels/cla-not-required","name":"cla-not-required","color":"159818","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-03-16T13:32:19Z","updated_at":"2017-03-19T04:41:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vmware/docker-volume-vsphere/pulls/1040","html_url":"https://github.com/vmware/docker-volume-vsphere/pull/1040","diff_url":"https://github.com/vmware/docker-volume-vsphere/pull/1040.diff","patch_url":"https://github.com/vmware/docker-volume-vsphere/pull/1040.patch"},"body":"When adding a PVSCSI contro;ller on first vmdk attach, at times the process takes around 5 seconds by which time the plugin timesout and fails the create operation. At times this takes just a second.\r\n\r\nTo ensure that the client is flexible to handle these scenarios first we try with a 1 secind timeout (default) and if the device is still not present then wait for a longer timeout of 5 seconds before giving up.\r\n\r\nIn the below sample adding a pvscsi controller is done in ~1 second,\r\n03/16/17 13:25:34 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk] [INFO   ] Attaching /vmfs/volumes/bigone/dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk as independent_persistent\r\n....\r\n03/16/17 13:25:34 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk] [DEBUG  ] backing_disk=Ubuntu-14.04-64-LTS-IMG/Ubuntu-14.04-64-LTS-IMG-000001.vmdk virtual_disk=dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk\r\n03/16/17 13:25:34 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk] [INFO   ] Adding a PVSCSI controller\r\n...\r\n03/16/17 13:25:35 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk] [INFO   ] executeRequest 'attach' completed with ret={'ControllerPciSlotNumber': '224', 'Unit': '0'}\r\n03/16/17 13:25:35 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz19.vmdk] [DEBUG  ] lib.vmci_reply: VMCI replied with errcode 0\r\n\r\n\r\nAnd in this case takes two seconds,\r\n03/16/17 13:16:00 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz14.vmdk] [INFO   ] Attaching /vmfs/volumes/bigone/dockvols/11111111-1111-1111-1111-111111111111/zzzz14.vmdk as independent_persistent\r\n\r\n...\r\n\r\n03/16/17 13:16:00 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz14.vmdk] [INFO   ] Adding a PVSCSI controller\r\n\r\n....\r\n\r\n03/16/17 13:16:02 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz14.vmdk] [INFO   ] executeRequest 'attach' completed with ret={'ControllerPciSlotNumber': '224', 'Unit': '0'}\r\n03/16/17 13:16:02 104884 [2 (1)-[bigone] dockvols/11111111-1111-1111-1111-111111111111/zzzz14.vmdk] [DEBUG  ] lib.vmci_reply: VMCI replied with errcode 0\r\n"},"comment":{"url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/comments/287594042","html_url":"https://github.com/vmware/docker-volume-vsphere/pull/1040#issuecomment-287594042","issue_url":"https://api.github.com/repos/vmware/docker-volume-vsphere/issues/1040","id":287594042,"user":{"login":"govint","id":15854712,"avatar_url":"https://avatars0.githubusercontent.com/u/15854712?v=3","gravatar_id":"","url":"https://api.github.com/users/govint","html_url":"https://github.com/govint","followers_url":"https://api.github.com/users/govint/followers","following_url":"https://api.github.com/users/govint/following{/other_user}","gists_url":"https://api.github.com/users/govint/gists{/gist_id}","starred_url":"https://api.github.com/users/govint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/govint/subscriptions","organizations_url":"https://api.github.com/users/govint/orgs","repos_url":"https://api.github.com/users/govint/repos","events_url":"https://api.github.com/users/govint/events{/privacy}","received_events_url":"https://api.github.com/users/govint/received_events","type":"User","site_admin":false},"created_at":"2017-03-19T04:41:14Z","updated_at":"2017-03-19T04:41:14Z","body":"Watcher is working fine, but the pvscsi controller add takes minimum 1 second and at least a max of 5  seconds.\r\n\r\nThe wather pkg (inotify and now fsnotify) doesn't implement a timeout based watch logic. A watcher is instantiated and then the logic is to loop waiting for events. This wait has to have an external timer as the watcher doesn't implement one. And the timer is to have a sleep. The way that works is a) check for the file events, b) if none sleep (timeout) c) break from watcher loop.\r\n\r\nAbove logic works is ok to handle device attach delays, except that (as mentioned ) pvscsi ctlr add is anywhere from 1 - 5 seconds. So, try a small timeout and then try a long timeout, typically the small timeout is what happens."}}
{"actor":{"display_login":"govint"}}