{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/16567","labels_url":"https://api.github.com/repos/docker/docker/issues/16567/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/16567/comments","events_url":"https://api.github.com/repos/docker/docker/issues/16567/events","html_url":"https://github.com/docker/docker/pull/16567","id":108223945,"number":16567,"title":"Define a context per request.","user":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"labels":[{"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":null,"comments":2,"created_at":"2015-09-24T22:12:44Z","updated_at":"2015-09-25T16:36:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/16567","html_url":"https://github.com/docker/docker/pull/16567","diff_url":"https://github.com/docker/docker/pull/16567.diff","patch_url":"https://github.com/docker/docker/pull/16567.patch"},"body":"Avoid creating a global context object that will be used while the daemon is running.\r\n\r\nNot only this object won't ever be garbage collected, but it won't ever be used for anything else than creating other contexts in each request. I think it's a bad practive to have something like this sprawling aroud the code.\r\n\r\nThis change removes that global object and initializes a context in the cases we don't have already one, like shutting down the server.\r\nThis also removes a bunch of context arguments from functions that did nothing with it.\r\n\r\n/cc @duglin\r\n\r\nSigned-off-by: David Calavera <david.calavera@gmail.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/143271000","html_url":"https://github.com/docker/docker/pull/16567#issuecomment-143271000","issue_url":"https://api.github.com/repos/docker/docker/issues/16567","id":143271000,"user":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T16:36:17Z","updated_at":"2015-09-25T16:36:17Z","body":"@duglin please, take a look at the code. Your change polluted a bunch of functions that don't need and won't ever need a context object. Causing, at the end, to just propagate an unused object around all the daemon code. Having it \"just in case we use it in the future\" is a bad reason to keep it.\r\n\r\n"}}