{"action":"opened","number":110,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/110","id":176981532,"html_url":"https://github.com/jenkinsci/windows-azure-storage-plugin/pull/110","diff_url":"https://github.com/jenkinsci/windows-azure-storage-plugin/pull/110.diff","patch_url":"https://github.com/jenkinsci/windows-azure-storage-plugin/pull/110.patch","issue_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/110","number":110,"state":"open","locked":false,"title":"Fix ensuring directory exist in multi thread bug.","user":{"login":"gavinfish","id":6169722,"avatar_url":"https://avatars2.githubusercontent.com/u/6169722?v=4","gravatar_id":"","url":"https://api.github.com/users/gavinfish","html_url":"https://github.com/gavinfish","followers_url":"https://api.github.com/users/gavinfish/followers","following_url":"https://api.github.com/users/gavinfish/following{/other_user}","gists_url":"https://api.github.com/users/gavinfish/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinfish/subscriptions","organizations_url":"https://api.github.com/users/gavinfish/orgs","repos_url":"https://api.github.com/users/gavinfish/repos","events_url":"https://api.github.com/users/gavinfish/events{/privacy}","received_events_url":"https://api.github.com/users/gavinfish/received_events","type":"User","site_admin":false},"body":"Related with PR #103 .\r\n\r\nWhen uploading artifacts to share files, we need to check if the directory exists first.  If doing this in `uploadCloudFile` method which would be executed in several uploading threads without concurrency control, it may cause exception like below:\r\n\r\n```\r\ncom.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException: fail to create directory.\r\n\tat com.microsoftopentechnologies.windowsazurestorage.service.UploadService.ensureDirExist(UploadService.java:301)\r\n\tat com.microsoftopentechnologies.windowsazurestorage.service.UploadService.uploadCloudFile(UploadService.java:262)\r\n\tat com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadThread.run(UploadService.java:101)\r\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\nCaused by: com.microsoft.azure.storage.StorageException: Conflict\r\n\tat com.microsoft.azure.storage.StorageException.translateException(StorageException.java:89)\r\n\tat com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:305)\r\n\tat com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:175)\r\n\tat com.microsoft.azure.storage.file.CloudFileDirectory.create(CloudFileDirectory.java:200)\r\n\tat com.microsoft.azure.storage.file.CloudFileDirectory.create(CloudFileDirectory.java:173)\r\n\tat com.microsoftopentechnologies.windowsazurestorage.service.UploadService.ensureDirExist(UploadService.java:298)\r\n\t... 7 more\r\nMicrosoftAzureStorage - Error occurred while downloading from Azure - vscodejenkins:fail to create directory.\r\n```\r\n\r\nSo we should add concurrency control for `ensureDirExist` or we can do this check in `uploadIndividuals` method which is executed in main thread.","created_at":"2018-03-23T06:08:59Z","updated_at":"2018-03-23T06:08:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/110/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/110/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/110/comments","statuses_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/statuses/e06cc8ec611852f4c7b856aaca5ea3435460feca","head":{"label":"jenkinsci:fix_multi_create_file","ref":"fix_multi_create_file","sha":"e06cc8ec611852f4c7b856aaca5ea3435460feca","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":9200713,"name":"windows-azure-storage-plugin","full_name":"jenkinsci/windows-azure-storage-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/windows-azure-storage-plugin","description":null,"fork":false,"url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin","forks_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/deployments","created_at":"2013-04-03T17:35:44Z","updated_at":"2018-03-22T06:52:34Z","pushed_at":"2018-03-23T05:58:16Z","git_url":"git://github.com/jenkinsci/windows-azure-storage-plugin.git","ssh_url":"git@github.com:jenkinsci/windows-azure-storage-plugin.git","clone_url":"https://github.com/jenkinsci/windows-azure-storage-plugin.git","svn_url":"https://github.com/jenkinsci/windows-azure-storage-plugin","homepage":"","size":482,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":39,"open_issues":8,"watchers":18,"default_branch":"dev"}},"base":{"label":"jenkinsci:dev","ref":"dev","sha":"10401f13a34787ea29e6a251664004b847d59cbb","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":9200713,"name":"windows-azure-storage-plugin","full_name":"jenkinsci/windows-azure-storage-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/windows-azure-storage-plugin","description":null,"fork":false,"url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin","forks_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/deployments","created_at":"2013-04-03T17:35:44Z","updated_at":"2018-03-22T06:52:34Z","pushed_at":"2018-03-23T05:58:16Z","git_url":"git://github.com/jenkinsci/windows-azure-storage-plugin.git","ssh_url":"git@github.com:jenkinsci/windows-azure-storage-plugin.git","clone_url":"https://github.com/jenkinsci/windows-azure-storage-plugin.git","svn_url":"https://github.com/jenkinsci/windows-azure-storage-plugin","homepage":"","size":482,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":39,"open_issues":8,"watchers":18,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/110"},"html":{"href":"https://github.com/jenkinsci/windows-azure-storage-plugin/pull/110"},"issue":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/110"},"comments":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/windows-azure-storage-plugin/statuses/e06cc8ec611852f4c7b856aaca5ea3435460feca"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":14,"deletions":16,"changed_files":2}}
{"actor":{"display_login":"gavinfish"}}