{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/15735","labels_url":"https://api.github.com/repos/docker/docker/issues/15735/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/15735/comments","events_url":"https://api.github.com/repos/docker/docker/issues/15735/events","html_url":"https://github.com/docker/docker/pull/15735","id":102241626,"number":15735,"title":"Make graph.Register take in io.ReadCloser","user":{"login":"tonistiigi","id":585223,"avatar_url":"https://avatars.githubusercontent.com/u/585223?v=3","gravatar_id":"","url":"https://api.github.com/users/tonistiigi","html_url":"https://github.com/tonistiigi","followers_url":"https://api.github.com/users/tonistiigi/followers","following_url":"https://api.github.com/users/tonistiigi/following{/other_user}","gists_url":"https://api.github.com/users/tonistiigi/gists{/gist_id}","starred_url":"https://api.github.com/users/tonistiigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonistiigi/subscriptions","organizations_url":"https://api.github.com/users/tonistiigi/orgs","repos_url":"https://api.github.com/users/tonistiigi/repos","events_url":"https://api.github.com/users/tonistiigi/events{/privacy}","received_events_url":"https://api.github.com/users/tonistiigi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/distribution","name":"group/distribution","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/41","html_url":"https://github.com/docker/docker/milestones/1.9.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/41/labels","id":1211905,"number":41,"title":"1.9.0","description":"","creator":{"login":"dmp42","id":332946,"avatar_url":"https://avatars.githubusercontent.com/u/332946?v=3","gravatar_id":"","url":"https://api.github.com/users/dmp42","html_url":"https://github.com/dmp42","followers_url":"https://api.github.com/users/dmp42/followers","following_url":"https://api.github.com/users/dmp42/following{/other_user}","gists_url":"https://api.github.com/users/dmp42/gists{/gist_id}","starred_url":"https://api.github.com/users/dmp42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmp42/subscriptions","organizations_url":"https://api.github.com/users/dmp42/orgs","repos_url":"https://api.github.com/users/dmp42/repos","events_url":"https://api.github.com/users/dmp42/events{/privacy}","received_events_url":"https://api.github.com/users/dmp42/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":2,"state":"open","created_at":"2015-07-16T20:50:09Z","updated_at":"2015-08-20T23:41:54Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-08-20T21:28:29Z","updated_at":"2015-08-21T01:01:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/15735","html_url":"https://github.com/docker/docker/pull/15735","diff_url":"https://github.com/docker/docker/pull/15735.diff","patch_url":"https://github.com/docker/docker/pull/15735.patch"},"body":"Make graph.Register take in io.ReadCloser so it can close it.\r\n\r\nAs requested by @stevvooe in #15728\r\n\r\nSigned-off-by: Tonis Tiigi <tonistiigi@gmail.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/133233372","html_url":"https://github.com/docker/docker/pull/15735#issuecomment-133233372","issue_url":"https://api.github.com/repos/docker/docker/issues/15735","id":133233372,"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},"created_at":"2015-08-21T01:01:33Z","updated_at":"2015-08-21T01:01:33Z","body":"I think this PR should remove the existing calls to `Close`, which I believe are these two:\r\n\r\nhttps://github.com/docker/docker/blob/master/graph/pull_v1.go#L305\r\nhttps://github.com/docker/docker/blob/master/graph/pull_v2.go#L282\r\n\r\n`io.ReadCloser` provides no guarantee that `Close` can be called multiple times: \"The behavior of Close after the first call is undefined. Specific implementations may document their own behavior.\" Even if it's harmless to call `Close` twice, it's not good to have extra calls to `Close` that are expected to fail.\r\n\r\nNote that in the pull_v2.go case, it will take some extra logic to make sure `Close` is called exactly once, since there are some paths where `Register` does not get called."}}