{"action":"opened","number":2347,"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/2347","id":35602294,"html_url":"https://github.com/juju/juju/pull/2347","diff_url":"https://github.com/juju/juju/pull/2347.diff","patch_url":"https://github.com/juju/juju/pull/2347.patch","issue_url":"https://api.github.com/repos/juju/juju/issues/2347","number":2347,"state":"open","locked":false,"title":"When using blobstore to add/read images, retry in there's an i/o error","user":{"login":"wallyworld","id":5808968,"avatar_url":"https://avatars.githubusercontent.com/u/5808968?v=3","gravatar_id":"","url":"https://api.github.com/users/wallyworld","html_url":"https://github.com/wallyworld","followers_url":"https://api.github.com/users/wallyworld/followers","following_url":"https://api.github.com/users/wallyworld/following{/other_user}","gists_url":"https://api.github.com/users/wallyworld/gists{/gist_id}","starred_url":"https://api.github.com/users/wallyworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallyworld/subscriptions","organizations_url":"https://api.github.com/users/wallyworld/orgs","repos_url":"https://api.github.com/users/wallyworld/repos","events_url":"https://api.github.com/users/wallyworld/events{/privacy}","received_events_url":"https://api.github.com/users/wallyworld/received_events","type":"User","site_admin":false},"body":"Fixes: https://bugs.launchpad.net/juju-core/+bug/1454676\r\n\r\nWe have a couple of issues when deployer is used to deploy a bundle and everything is done at once.\r\nFirstly, I/O contention - fetching and storing the LXC image template in the blob store fails due to an I/O timeout. Some LXC containers do start, so Juju should just retry in such cases.\r\nThe other issue is that multiple downloads of the same image are allowed to occur - if a download for a given image is already in progress, any new requests should wait and use that image once the initial download completes.\r\n\r\nSo a helper is created that can be used to retry transient network operations that fail. This is just used here for loading/saving images to blob store, but can be used elsewhere when needed.\r\nThe other fix is to add a lock to the image fetching so that it only happens once. This reduces I/O contention on the blobstore, and fixes an obvious implementation inefficiency.","created_at":"2015-05-18T04:38:38Z","updated_at":"2015-05-18T04:38:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c64e46e8362ad0f371650edf869fb316113a6d7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju/juju/pulls/2347/commits","review_comments_url":"https://api.github.com/repos/juju/juju/pulls/2347/comments","review_comment_url":"https://api.github.com/repos/juju/juju/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/juju/issues/2347/comments","statuses_url":"https://api.github.com/repos/juju/juju/statuses/9b67bc501d814103d3161a8ee75a7ce9c8216b74","head":{"label":"wallyworld:robust-lxc-images","ref":"robust-lxc-images","sha":"9b67bc501d814103d3161a8ee75a7ce9c8216b74","user":{"login":"wallyworld","id":5808968,"avatar_url":"https://avatars.githubusercontent.com/u/5808968?v=3","gravatar_id":"","url":"https://api.github.com/users/wallyworld","html_url":"https://github.com/wallyworld","followers_url":"https://api.github.com/users/wallyworld/followers","following_url":"https://api.github.com/users/wallyworld/following{/other_user}","gists_url":"https://api.github.com/users/wallyworld/gists{/gist_id}","starred_url":"https://api.github.com/users/wallyworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallyworld/subscriptions","organizations_url":"https://api.github.com/users/wallyworld/orgs","repos_url":"https://api.github.com/users/wallyworld/repos","events_url":"https://api.github.com/users/wallyworld/events{/privacy}","received_events_url":"https://api.github.com/users/wallyworld/received_events","type":"User","site_admin":false},"repo":{"id":20465218,"name":"juju","full_name":"wallyworld/juju","owner":{"login":"wallyworld","id":5808968,"avatar_url":"https://avatars.githubusercontent.com/u/5808968?v=3","gravatar_id":"","url":"https://api.github.com/users/wallyworld","html_url":"https://github.com/wallyworld","followers_url":"https://api.github.com/users/wallyworld/followers","following_url":"https://api.github.com/users/wallyworld/following{/other_user}","gists_url":"https://api.github.com/users/wallyworld/gists{/gist_id}","starred_url":"https://api.github.com/users/wallyworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallyworld/subscriptions","organizations_url":"https://api.github.com/users/wallyworld/orgs","repos_url":"https://api.github.com/users/wallyworld/repos","events_url":"https://api.github.com/users/wallyworld/events{/privacy}","received_events_url":"https://api.github.com/users/wallyworld/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wallyworld/juju","description":"juju is devops distilled","fork":true,"url":"https://api.github.com/repos/wallyworld/juju","forks_url":"https://api.github.com/repos/wallyworld/juju/forks","keys_url":"https://api.github.com/repos/wallyworld/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wallyworld/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wallyworld/juju/teams","hooks_url":"https://api.github.com/repos/wallyworld/juju/hooks","issue_events_url":"https://api.github.com/repos/wallyworld/juju/issues/events{/number}","events_url":"https://api.github.com/repos/wallyworld/juju/events","assignees_url":"https://api.github.com/repos/wallyworld/juju/assignees{/user}","branches_url":"https://api.github.com/repos/wallyworld/juju/branches{/branch}","tags_url":"https://api.github.com/repos/wallyworld/juju/tags","blobs_url":"https://api.github.com/repos/wallyworld/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wallyworld/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wallyworld/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/wallyworld/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wallyworld/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/wallyworld/juju/languages","stargazers_url":"https://api.github.com/repos/wallyworld/juju/stargazers","contributors_url":"https://api.github.com/repos/wallyworld/juju/contributors","subscribers_url":"https://api.github.com/repos/wallyworld/juju/subscribers","subscription_url":"https://api.github.com/repos/wallyworld/juju/subscription","commits_url":"https://api.github.com/repos/wallyworld/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/wallyworld/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/wallyworld/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/wallyworld/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/wallyworld/juju/contents/{+path}","compare_url":"https://api.github.com/repos/wallyworld/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wallyworld/juju/merges","archive_url":"https://api.github.com/repos/wallyworld/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wallyworld/juju/downloads","issues_url":"https://api.github.com/repos/wallyworld/juju/issues{/number}","pulls_url":"https://api.github.com/repos/wallyworld/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/wallyworld/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/wallyworld/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wallyworld/juju/labels{/name}","releases_url":"https://api.github.com/repos/wallyworld/juju/releases{/id}","created_at":"2014-06-04T00:56:12Z","updated_at":"2015-05-05T23:27:26Z","pushed_at":"2015-05-18T04:33:52Z","git_url":"git://github.com/wallyworld/juju.git","ssh_url":"git@github.com:wallyworld/juju.git","clone_url":"https://github.com/wallyworld/juju.git","svn_url":"https://github.com/wallyworld/juju","homepage":null,"size":54412,"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":"juju:1.24","ref":"1.24","sha":"d55e644d862d6809561ee5b4f337c16db5a75cc5","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20445947,"name":"juju","full_name":"juju/juju","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/juju","description":"juju is devops distilled","fork":false,"url":"https://api.github.com/repos/juju/juju","forks_url":"https://api.github.com/repos/juju/juju/forks","keys_url":"https://api.github.com/repos/juju/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/juju/teams","hooks_url":"https://api.github.com/repos/juju/juju/hooks","issue_events_url":"https://api.github.com/repos/juju/juju/issues/events{/number}","events_url":"https://api.github.com/repos/juju/juju/events","assignees_url":"https://api.github.com/repos/juju/juju/assignees{/user}","branches_url":"https://api.github.com/repos/juju/juju/branches{/branch}","tags_url":"https://api.github.com/repos/juju/juju/tags","blobs_url":"https://api.github.com/repos/juju/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/juju/languages","stargazers_url":"https://api.github.com/repos/juju/juju/stargazers","contributors_url":"https://api.github.com/repos/juju/juju/contributors","subscribers_url":"https://api.github.com/repos/juju/juju/subscribers","subscription_url":"https://api.github.com/repos/juju/juju/subscription","commits_url":"https://api.github.com/repos/juju/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/juju/contents/{+path}","compare_url":"https://api.github.com/repos/juju/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/juju/merges","archive_url":"https://api.github.com/repos/juju/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/juju/downloads","issues_url":"https://api.github.com/repos/juju/juju/issues{/number}","pulls_url":"https://api.github.com/repos/juju/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/juju/labels{/name}","releases_url":"https://api.github.com/repos/juju/juju/releases{/id}","created_at":"2014-06-03T14:28:10Z","updated_at":"2015-05-16T13:11:53Z","pushed_at":"2015-05-18T04:38:38Z","git_url":"git://github.com/juju/juju.git","ssh_url":"git@github.com:juju/juju.git","clone_url":"https://github.com/juju/juju.git","svn_url":"https://github.com/juju/juju","homepage":"juju.ubuntu.com","size":91053,"stargazers_count":276,"watchers_count":276,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":90,"mirror_url":null,"open_issues_count":66,"forks":90,"open_issues":66,"watchers":276,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/2347"},"html":{"href":"https://github.com/juju/juju/pull/2347"},"issue":{"href":"https://api.github.com/repos/juju/juju/issues/2347"},"comments":{"href":"https://api.github.com/repos/juju/juju/issues/2347/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju/pulls/2347/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/juju/pulls/2347/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju/statuses/9b67bc501d814103d3161a8ee75a7ce9c8216b74"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":272,"deletions":25,"changed_files":5}}