{"action":"closed","issue":{"url":"https://api.github.com/repos/yhat/go-docker/issues/2","labels_url":"https://api.github.com/repos/yhat/go-docker/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/yhat/go-docker/issues/2/comments","events_url":"https://api.github.com/repos/yhat/go-docker/issues/2/events","html_url":"https://github.com/yhat/go-docker/issues/2","id":98030529,"number":2,"title":"Leaking file handles","user":{"login":"ericchiang","id":2342749,"avatar_url":"https://avatars.githubusercontent.com/u/2342749?v=3","gravatar_id":"","url":"https://api.github.com/users/ericchiang","html_url":"https://github.com/ericchiang","followers_url":"https://api.github.com/users/ericchiang/followers","following_url":"https://api.github.com/users/ericchiang/following{/other_user}","gists_url":"https://api.github.com/users/ericchiang/gists{/gist_id}","starred_url":"https://api.github.com/users/ericchiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericchiang/subscriptions","organizations_url":"https://api.github.com/users/ericchiang/orgs","repos_url":"https://api.github.com/users/ericchiang/repos","events_url":"https://api.github.com/users/ericchiang/events{/privacy}","received_events_url":"https://api.github.com/users/ericchiang/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yhat/go-docker/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-29T21:13:23Z","updated_at":"2015-07-29T21:39:57Z","closed_at":"2015-07-29T21:39:57Z","body":"This program causes docker to leak file handles\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"log\"\r\n\t\"time\"\r\n\r\n\t\"github.com/yhat/go-docker\"\r\n)\r\n\r\nfunc main() {\r\n\tvar i int64\r\n\r\n\tfor {\r\n\t\ti++\r\n\t\tif i%100 == 0 {\r\n\t\t\tlog.Println(\"loop\", i)\r\n\t\t}\r\n\r\n\t\tcli, err := docker.NewDefaultClient(3 * time.Second)\r\n\t\tif err != nil {\r\n\t\t\tlog.Println(\"could not create docker client: %v\", err)\r\n\t\t\ttime.Sleep(1 * time.Second)\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tif _, err := cli.ListContainers(false, true, \"\"); err != nil {\r\n\t\t\tlog.Println(\"could not get docker containers\", err)\r\n\t\t\ttime.Sleep(1 * time.Second)\r\n\t\t}\r\n\t}\r\n}\r\n```"}}