{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/69370816","id":69370816,"diff_hunk":"@@ -106,6 +106,8 @@ func (pm *Manager) Push(name string, metaHeader http.Header, authConfig *types.A\n \tif err != nil {\n \t\treturn err\n \t}\n+\tdefer config.Close()","path":"plugin/backend.go","position":4,"original_position":4,"commit_id":"51f662f12538b14dc4ca07f83a3149cb5bdbe29b","original_commit_id":"51f662f12538b14dc4ca07f83a3149cb5bdbe29b","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"body":"This is closed inside `Push` but it's done imperfectly. There are cases where `Push` returns without closing `rootfs` and `config`. We may want to change `Push` to take `io.Reader`s and do the closing of `config` and `rootfs` in this function.","created_at":"2016-07-02T01:57:08Z","updated_at":"2016-07-02T01:57:08Z","html_url":"https://github.com/docker/docker/pull/23951#discussion_r69370816","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/23951","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/69370816"},"html":{"href":"https://github.com/docker/docker/pull/23951#discussion_r69370816"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/23951"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/23951","id":75195203,"html_url":"https://github.com/docker/docker/pull/23951","diff_url":"https://github.com/docker/docker/pull/23951.diff","patch_url":"https://github.com/docker/docker/pull/23951.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/23951","number":23951,"state":"open","locked":false,"title":"add defer file.Close to avoid potential fd leak","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"body":"When I read swarm code in docker engine, found that there is some file did not close.\r\nThen I tried to find out all such kind of situations, added a defer to avoid potential fd leak.","created_at":"2016-06-25T04:01:17Z","updated_at":"2016-07-02T01:57:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa4b114207d28fb9a6c3262e46ce351da270fb56","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/53","html_url":"https://github.com/docker/docker/milestones/1.12.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/53/labels","id":1657301,"number":53,"title":"1.12.0","description":"feature/code freeze: June 14th, 2016","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":119,"closed_issues":469,"state":"open","created_at":"2016-03-21T13:47:53Z","updated_at":"2016-07-02T01:49:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/23951/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/23951/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/23951/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/51f662f12538b14dc4ca07f83a3149cb5bdbe29b","head":{"label":"allencloud:defer-os-file-close","ref":"defer-os-file-close","sha":"51f662f12538b14dc4ca07f83a3149cb5bdbe29b","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"repo":{"id":52540894,"name":"docker","full_name":"allencloud/docker","owner":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allencloud/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/allencloud/docker","forks_url":"https://api.github.com/repos/allencloud/docker/forks","keys_url":"https://api.github.com/repos/allencloud/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allencloud/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allencloud/docker/teams","hooks_url":"https://api.github.com/repos/allencloud/docker/hooks","issue_events_url":"https://api.github.com/repos/allencloud/docker/issues/events{/number}","events_url":"https://api.github.com/repos/allencloud/docker/events","assignees_url":"https://api.github.com/repos/allencloud/docker/assignees{/user}","branches_url":"https://api.github.com/repos/allencloud/docker/branches{/branch}","tags_url":"https://api.github.com/repos/allencloud/docker/tags","blobs_url":"https://api.github.com/repos/allencloud/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allencloud/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allencloud/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/allencloud/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allencloud/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/allencloud/docker/languages","stargazers_url":"https://api.github.com/repos/allencloud/docker/stargazers","contributors_url":"https://api.github.com/repos/allencloud/docker/contributors","subscribers_url":"https://api.github.com/repos/allencloud/docker/subscribers","subscription_url":"https://api.github.com/repos/allencloud/docker/subscription","commits_url":"https://api.github.com/repos/allencloud/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/allencloud/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/allencloud/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/allencloud/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/allencloud/docker/contents/{+path}","compare_url":"https://api.github.com/repos/allencloud/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allencloud/docker/merges","archive_url":"https://api.github.com/repos/allencloud/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allencloud/docker/downloads","issues_url":"https://api.github.com/repos/allencloud/docker/issues{/number}","pulls_url":"https://api.github.com/repos/allencloud/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/allencloud/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/allencloud/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allencloud/docker/labels{/name}","releases_url":"https://api.github.com/repos/allencloud/docker/releases{/id}","deployments_url":"https://api.github.com/repos/allencloud/docker/deployments","created_at":"2016-02-25T16:46:58Z","updated_at":"2016-02-25T16:47:09Z","pushed_at":"2016-07-01T05:03:00Z","git_url":"git://github.com/allencloud/docker.git","ssh_url":"git@github.com:allencloud/docker.git","clone_url":"https://github.com/allencloud/docker.git","svn_url":"https://github.com/allencloud/docker","homepage":"http://www.docker.com","size":96457,"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":"docker:master","ref":"master","sha":"cccfe63e86f3842a2139d8b9c24bfab5be7639b8","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-07-02T01:56:43Z","pushed_at":"2016-07-02T01:35:32Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":203686,"stargazers_count":32600,"watchers_count":32600,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9419,"mirror_url":null,"open_issues_count":1915,"forks":9419,"open_issues":1915,"watchers":32600,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/23951"},"html":{"href":"https://github.com/docker/docker/pull/23951"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/23951"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/23951/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/23951/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/23951/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/51f662f12538b14dc4ca07f83a3149cb5bdbe29b"}}}}
{"actor":{"display_login":"aaronlehmann"}}