{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/93949551","pull_request_review_id":14480565,"id":93949551,"diff_hunk":"@@ -126,6 +129,20 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c\n \t\t\tif !config.Stream {\n \t\t\t\treturn nil\n \t\t\t}\n+\t\tcase <-time.After(statsInterval):","path":"daemon/stats.go","position":23,"original_position":23,"commit_id":"a7736165c7f6610b0d47647dd76d6cb5724b8206","original_commit_id":"a7736165c7f6610b0d47647dd76d6cb5724b8206","user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"body":"sound more like `time.Ticker` for me","created_at":"2016-12-27T16:52:15Z","updated_at":"2016-12-27T16:56:27Z","html_url":"https://github.com/docker/docker/pull/29702#discussion_r93949551","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/29702","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/93949551"},"html":{"href":"https://github.com/docker/docker/pull/29702#discussion_r93949551"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/29702"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/29702","id":99361371,"html_url":"https://github.com/docker/docker/pull/29702","diff_url":"https://github.com/docker/docker/pull/29702.diff","patch_url":"https://github.com/docker/docker/pull/29702.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/29702","number":29702,"state":"open","locked":false,"title":"Fix panic of \"docker stats --format {{.Name}} --all\"","user":{"login":"WeiZhang555","id":1203611,"avatar_url":"https://avatars.githubusercontent.com/u/1203611?v=3","gravatar_id":"","url":"https://api.github.com/users/WeiZhang555","html_url":"https://github.com/WeiZhang555","followers_url":"https://api.github.com/users/WeiZhang555/followers","following_url":"https://api.github.com/users/WeiZhang555/following{/other_user}","gists_url":"https://api.github.com/users/WeiZhang555/gists{/gist_id}","starred_url":"https://api.github.com/users/WeiZhang555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeiZhang555/subscriptions","organizations_url":"https://api.github.com/users/WeiZhang555/orgs","repos_url":"https://api.github.com/users/WeiZhang555/repos","events_url":"https://api.github.com/users/WeiZhang555/events{/privacy}","received_events_url":"https://api.github.com/users/WeiZhang555/received_events","type":"User","site_admin":false},"body":"This commit fixes panic when execute stats command:\r\n\r\n* use `--format {{.Name}}` with `--all` when there're exited containers.\r\n* use `--format {{.Name}}` while stating exited container.\r\n\r\nThe root cause is when stating an exited container, the result from the\r\napi didn't contain the `Name` and `ID` field, which will make `format`\r\nprocess panic.\r\n\r\nPanic log is like this:\r\n\r\n```\r\npanic: runtime error: slice bounds out of range [recovered]\r\n\tpanic: runtime error: slice bounds out of range\r\n\r\ngoroutine 1 [running]:\r\npanic(0xb20f80, 0xc420014110)\r\n\t/usr/local/go/src/runtime/panic.go:500 +0x1a1\r\ntext/template.errRecover(0xc4201773e8)\r\n\t/usr/local/go/src/text/template/exec.go:140 +0x2ad\r\npanic(0xb20f80, 0xc420014110)\r\n\t/usr/local/go/src/runtime/panic.go:458 +0x243\r\ngithub.com/docker/docker/cli/command/formatter.(*containerStatsContext).Name(0xc420430160,\r\n0x0, 0x0)\r\n\t/go/src/github.com/docker/docker/cli/command/formatter/stats.go:148\r\n+0x86\r\nreflect.Value.call(0xb9a3a0, 0xc420430160, 0x2213, 0xbe3657, 0x4,\r\n0x11bc9f8, 0x0, 0x0, 0x4d75b3, 0x1198940, ...)\r\n\t/usr/local/go/src/reflect/value.go:434 +0x5c8\r\nreflect.Value.Call(0xb9a3a0, 0xc420430160, 0x2213, 0x11bc9f8, 0x0, 0x0,\r\n0xc420424028, 0xb, 0xb)\r\n\t/usr/local/go/src/reflect/value.go:302 +0xa4\r\ntext/template.(*state).evalCall(0xc420177368, 0xb9a3a0, 0xc420430160,\r\n0x16, 0xb9a3a0, 0xc420430160, 0x2213, 0x1178fa0, 0xc4203ea330,\r\n0xc4203de283, ...)\r\n\t/usr/local/go/src/text/template/exec.go:658 +0x530\r\n```\r\n\r\nSigned-off-by: Zhang Wei <zhangwei555@huawei.com>\r\n\r\nIntroduced in https://github.com/docker/docker/pull/27797, ping @vdemeester ","created_at":"2016-12-26T11:02:07Z","updated_at":"2016-12-27T16:56:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3dbb7c0f57ac9c11e9600532448e61d86d33043c","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/56","html_url":"https://github.com/docker/docker/milestone/56","labels_url":"https://api.github.com/repos/docker/docker/milestones/56/labels","id":1839404,"number":56,"title":"1.13.0","description":"","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":104,"closed_issues":1284,"state":"open","created_at":"2016-06-20T22:51:25Z","updated_at":"2016-12-27T16:46:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/29702/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/29702/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/29702/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/a7736165c7f6610b0d47647dd76d6cb5724b8206","head":{"label":"WeiZhang555:stats-all-format-name-panic","ref":"stats-all-format-name-panic","sha":"a7736165c7f6610b0d47647dd76d6cb5724b8206","user":{"login":"WeiZhang555","id":1203611,"avatar_url":"https://avatars.githubusercontent.com/u/1203611?v=3","gravatar_id":"","url":"https://api.github.com/users/WeiZhang555","html_url":"https://github.com/WeiZhang555","followers_url":"https://api.github.com/users/WeiZhang555/followers","following_url":"https://api.github.com/users/WeiZhang555/following{/other_user}","gists_url":"https://api.github.com/users/WeiZhang555/gists{/gist_id}","starred_url":"https://api.github.com/users/WeiZhang555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeiZhang555/subscriptions","organizations_url":"https://api.github.com/users/WeiZhang555/orgs","repos_url":"https://api.github.com/users/WeiZhang555/repos","events_url":"https://api.github.com/users/WeiZhang555/events{/privacy}","received_events_url":"https://api.github.com/users/WeiZhang555/received_events","type":"User","site_admin":false},"repo":{"id":29129000,"name":"docker","full_name":"WeiZhang555/docker","owner":{"login":"WeiZhang555","id":1203611,"avatar_url":"https://avatars.githubusercontent.com/u/1203611?v=3","gravatar_id":"","url":"https://api.github.com/users/WeiZhang555","html_url":"https://github.com/WeiZhang555","followers_url":"https://api.github.com/users/WeiZhang555/followers","following_url":"https://api.github.com/users/WeiZhang555/following{/other_user}","gists_url":"https://api.github.com/users/WeiZhang555/gists{/gist_id}","starred_url":"https://api.github.com/users/WeiZhang555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeiZhang555/subscriptions","organizations_url":"https://api.github.com/users/WeiZhang555/orgs","repos_url":"https://api.github.com/users/WeiZhang555/repos","events_url":"https://api.github.com/users/WeiZhang555/events{/privacy}","received_events_url":"https://api.github.com/users/WeiZhang555/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WeiZhang555/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/WeiZhang555/docker","forks_url":"https://api.github.com/repos/WeiZhang555/docker/forks","keys_url":"https://api.github.com/repos/WeiZhang555/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WeiZhang555/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WeiZhang555/docker/teams","hooks_url":"https://api.github.com/repos/WeiZhang555/docker/hooks","issue_events_url":"https://api.github.com/repos/WeiZhang555/docker/issues/events{/number}","events_url":"https://api.github.com/repos/WeiZhang555/docker/events","assignees_url":"https://api.github.com/repos/WeiZhang555/docker/assignees{/user}","branches_url":"https://api.github.com/repos/WeiZhang555/docker/branches{/branch}","tags_url":"https://api.github.com/repos/WeiZhang555/docker/tags","blobs_url":"https://api.github.com/repos/WeiZhang555/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WeiZhang555/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WeiZhang555/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/WeiZhang555/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WeiZhang555/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/WeiZhang555/docker/languages","stargazers_url":"https://api.github.com/repos/WeiZhang555/docker/stargazers","contributors_url":"https://api.github.com/repos/WeiZhang555/docker/contributors","subscribers_url":"https://api.github.com/repos/WeiZhang555/docker/subscribers","subscription_url":"https://api.github.com/repos/WeiZhang555/docker/subscription","commits_url":"https://api.github.com/repos/WeiZhang555/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/WeiZhang555/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/WeiZhang555/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/WeiZhang555/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/WeiZhang555/docker/contents/{+path}","compare_url":"https://api.github.com/repos/WeiZhang555/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WeiZhang555/docker/merges","archive_url":"https://api.github.com/repos/WeiZhang555/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WeiZhang555/docker/downloads","issues_url":"https://api.github.com/repos/WeiZhang555/docker/issues{/number}","pulls_url":"https://api.github.com/repos/WeiZhang555/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/WeiZhang555/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/WeiZhang555/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WeiZhang555/docker/labels{/name}","releases_url":"https://api.github.com/repos/WeiZhang555/docker/releases{/id}","deployments_url":"https://api.github.com/repos/WeiZhang555/docker/deployments","created_at":"2015-01-12T09:50:32Z","updated_at":"2016-11-21T07:06:04Z","pushed_at":"2016-12-27T09:22:21Z","git_url":"git://github.com/WeiZhang555/docker.git","ssh_url":"git@github.com:WeiZhang555/docker.git","clone_url":"https://github.com/WeiZhang555/docker.git","svn_url":"https://github.com/WeiZhang555/docker","homepage":"http://www.docker.com","size":115115,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"b81f47a288bcc28d1fe0f6fb4f79636074dbf67c","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-12-27T16:31:55Z","pushed_at":"2016-12-27T16:55:56Z","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":119162,"stargazers_count":38160,"watchers_count":38160,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11395,"mirror_url":null,"open_issues_count":2069,"forks":11395,"open_issues":2069,"watchers":38160,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/29702"},"html":{"href":"https://github.com/docker/docker/pull/29702"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/29702"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/29702/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/29702/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/29702/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/a7736165c7f6610b0d47647dd76d6cb5724b8206"}}}}
{"actor":{"display_login":"LK4D4"}}