{"action":"created","comment":{"url":"https://api.github.com/repos/google/cadvisor/pulls/comments/25617407","id":25617407,"diff_hunk":"@@ -104,15 +103,10 @@ func checkIfStartOfOomMessages(line string) (bool, error) {\n // lines are checked against a regexp to check for the pid, process name, etc.\n // At the end of an oom message group, AnalyzeLines adds the new oomInstance to\n // oomLog\n-func (self *OomParser) analyzeLines(outPipe io.ReadCloser, outStream chan *OomInstance) {\n-\tioreader := bufio.NewReader(outPipe)\n+func (self *OomParser) analyzeLines(ioreader *bufio.Reader, outStream chan *OomInstance) {\n \tline, err := ioreader.ReadString('\\n')\n \tfor err == nil {","path":"utils/oomparser/oomparser.go","position":32,"original_position":32,"commit_id":"b671a79d6a6ab460f86c198e31bba2e3f722a6dd","original_commit_id":"b671a79d6a6ab460f86c198e31bba2e3f722a6dd","user":{"login":"vmarmol","id":985208,"avatar_url":"https://avatars.githubusercontent.com/u/985208?v=3","gravatar_id":"","url":"https://api.github.com/users/vmarmol","html_url":"https://github.com/vmarmol","followers_url":"https://api.github.com/users/vmarmol/followers","following_url":"https://api.github.com/users/vmarmol/following{/other_user}","gists_url":"https://api.github.com/users/vmarmol/gists{/gist_id}","starred_url":"https://api.github.com/users/vmarmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmarmol/subscriptions","organizations_url":"https://api.github.com/users/vmarmol/orgs","repos_url":"https://api.github.com/users/vmarmol/repos","events_url":"https://api.github.com/users/vmarmol/events{/privacy}","received_events_url":"https://api.github.com/users/vmarmol/received_events","type":"User","site_admin":false},"body":"This code is getting a bit hard to read, let's try to simplify it. We will never break out of this loop so lets make it an infinite loop with a read at the beginning. We should also only wait while the error is EOF:\r\n\r\n```Go\r\nvar line string\r\nvar err error\r\nfor true {\r\n    // Wait for more content to show up in the file.\r\n    for line, err = ioreader.ReadString('\\n'); err != nil && err == io.EOF; {\r\n        time.Sleep(100 * time.Millisecond)\r\n    }\r\n\r\n    // Do work...\r\n}\r\n```","created_at":"2015-03-02T17:27:05Z","updated_at":"2015-03-02T17:27:05Z","html_url":"https://github.com/google/cadvisor/pull/549#discussion_r25617407","pull_request_url":"https://api.github.com/repos/google/cadvisor/pulls/549","_links":{"self":{"href":"https://api.github.com/repos/google/cadvisor/pulls/comments/25617407"},"html":{"href":"https://github.com/google/cadvisor/pull/549#discussion_r25617407"},"pull_request":{"href":"https://api.github.com/repos/google/cadvisor/pulls/549"}}},"pull_request":{"url":"https://api.github.com/repos/google/cadvisor/pulls/549","id":30195300,"html_url":"https://github.com/google/cadvisor/pull/549","diff_url":"https://github.com/google/cadvisor/pull/549.diff","patch_url":"https://github.com/google/cadvisor/pull/549.patch","issue_url":"https://api.github.com/repos/google/cadvisor/issues/549","number":549,"state":"open","locked":false,"title":"Revised oomparser to not use all the cpu","user":{"login":"kateknister","id":4239739,"avatar_url":"https://avatars.githubusercontent.com/u/4239739?v=3","gravatar_id":"","url":"https://api.github.com/users/kateknister","html_url":"https://github.com/kateknister","followers_url":"https://api.github.com/users/kateknister/followers","following_url":"https://api.github.com/users/kateknister/following{/other_user}","gists_url":"https://api.github.com/users/kateknister/gists{/gist_id}","starred_url":"https://api.github.com/users/kateknister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kateknister/subscriptions","organizations_url":"https://api.github.com/users/kateknister/orgs","repos_url":"https://api.github.com/users/kateknister/repos","events_url":"https://api.github.com/users/kateknister/events{/privacy}","received_events_url":"https://api.github.com/users/kateknister/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-27T19:52:55Z","updated_at":"2015-03-02T17:27:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b20fb9cdc1840abc7f0a2e31bb84c7f9bc5565b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/cadvisor/pulls/549/commits","review_comments_url":"https://api.github.com/repos/google/cadvisor/pulls/549/comments","review_comment_url":"https://api.github.com/repos/google/cadvisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/cadvisor/issues/549/comments","statuses_url":"https://api.github.com/repos/google/cadvisor/statuses/b671a79d6a6ab460f86c198e31bba2e3f722a6dd","head":{"label":"kateknister:master","ref":"master","sha":"b671a79d6a6ab460f86c198e31bba2e3f722a6dd","user":{"login":"kateknister","id":4239739,"avatar_url":"https://avatars.githubusercontent.com/u/4239739?v=3","gravatar_id":"","url":"https://api.github.com/users/kateknister","html_url":"https://github.com/kateknister","followers_url":"https://api.github.com/users/kateknister/followers","following_url":"https://api.github.com/users/kateknister/following{/other_user}","gists_url":"https://api.github.com/users/kateknister/gists{/gist_id}","starred_url":"https://api.github.com/users/kateknister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kateknister/subscriptions","organizations_url":"https://api.github.com/users/kateknister/orgs","repos_url":"https://api.github.com/users/kateknister/repos","events_url":"https://api.github.com/users/kateknister/events{/privacy}","received_events_url":"https://api.github.com/users/kateknister/received_events","type":"User","site_admin":false},"repo":{"id":27933617,"name":"cadvisor-1","full_name":"kateknister/cadvisor-1","owner":{"login":"kateknister","id":4239739,"avatar_url":"https://avatars.githubusercontent.com/u/4239739?v=3","gravatar_id":"","url":"https://api.github.com/users/kateknister","html_url":"https://github.com/kateknister","followers_url":"https://api.github.com/users/kateknister/followers","following_url":"https://api.github.com/users/kateknister/following{/other_user}","gists_url":"https://api.github.com/users/kateknister/gists{/gist_id}","starred_url":"https://api.github.com/users/kateknister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kateknister/subscriptions","organizations_url":"https://api.github.com/users/kateknister/orgs","repos_url":"https://api.github.com/users/kateknister/repos","events_url":"https://api.github.com/users/kateknister/events{/privacy}","received_events_url":"https://api.github.com/users/kateknister/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kateknister/cadvisor-1","description":"Analyzes resource usage and performance characteristics of running containers.","fork":true,"url":"https://api.github.com/repos/kateknister/cadvisor-1","forks_url":"https://api.github.com/repos/kateknister/cadvisor-1/forks","keys_url":"https://api.github.com/repos/kateknister/cadvisor-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kateknister/cadvisor-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kateknister/cadvisor-1/teams","hooks_url":"https://api.github.com/repos/kateknister/cadvisor-1/hooks","issue_events_url":"https://api.github.com/repos/kateknister/cadvisor-1/issues/events{/number}","events_url":"https://api.github.com/repos/kateknister/cadvisor-1/events","assignees_url":"https://api.github.com/repos/kateknister/cadvisor-1/assignees{/user}","branches_url":"https://api.github.com/repos/kateknister/cadvisor-1/branches{/branch}","tags_url":"https://api.github.com/repos/kateknister/cadvisor-1/tags","blobs_url":"https://api.github.com/repos/kateknister/cadvisor-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kateknister/cadvisor-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kateknister/cadvisor-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/kateknister/cadvisor-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kateknister/cadvisor-1/statuses/{sha}","languages_url":"https://api.github.com/repos/kateknister/cadvisor-1/languages","stargazers_url":"https://api.github.com/repos/kateknister/cadvisor-1/stargazers","contributors_url":"https://api.github.com/repos/kateknister/cadvisor-1/contributors","subscribers_url":"https://api.github.com/repos/kateknister/cadvisor-1/subscribers","subscription_url":"https://api.github.com/repos/kateknister/cadvisor-1/subscription","commits_url":"https://api.github.com/repos/kateknister/cadvisor-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/kateknister/cadvisor-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/kateknister/cadvisor-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/kateknister/cadvisor-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/kateknister/cadvisor-1/contents/{+path}","compare_url":"https://api.github.com/repos/kateknister/cadvisor-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kateknister/cadvisor-1/merges","archive_url":"https://api.github.com/repos/kateknister/cadvisor-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kateknister/cadvisor-1/downloads","issues_url":"https://api.github.com/repos/kateknister/cadvisor-1/issues{/number}","pulls_url":"https://api.github.com/repos/kateknister/cadvisor-1/pulls{/number}","milestones_url":"https://api.github.com/repos/kateknister/cadvisor-1/milestones{/number}","notifications_url":"https://api.github.com/repos/kateknister/cadvisor-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kateknister/cadvisor-1/labels{/name}","releases_url":"https://api.github.com/repos/kateknister/cadvisor-1/releases{/id}","created_at":"2014-12-12T18:53:19Z","updated_at":"2015-02-28T00:56:24Z","pushed_at":"2015-02-28T01:50:16Z","git_url":"git://github.com/kateknister/cadvisor-1.git","ssh_url":"git@github.com:kateknister/cadvisor-1.git","clone_url":"https://github.com/kateknister/cadvisor-1.git","svn_url":"https://github.com/kateknister/cadvisor-1","homepage":"","size":18947,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"google:master","ref":"master","sha":"4066286c854833bdbbdb17176b632445ad6953ff","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":20653934,"name":"cadvisor","full_name":"google/cadvisor","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/cadvisor","description":"Analyzes resource usage and performance characteristics of running containers.","fork":false,"url":"https://api.github.com/repos/google/cadvisor","forks_url":"https://api.github.com/repos/google/cadvisor/forks","keys_url":"https://api.github.com/repos/google/cadvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/cadvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/cadvisor/teams","hooks_url":"https://api.github.com/repos/google/cadvisor/hooks","issue_events_url":"https://api.github.com/repos/google/cadvisor/issues/events{/number}","events_url":"https://api.github.com/repos/google/cadvisor/events","assignees_url":"https://api.github.com/repos/google/cadvisor/assignees{/user}","branches_url":"https://api.github.com/repos/google/cadvisor/branches{/branch}","tags_url":"https://api.github.com/repos/google/cadvisor/tags","blobs_url":"https://api.github.com/repos/google/cadvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/cadvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/cadvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/cadvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/cadvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/google/cadvisor/languages","stargazers_url":"https://api.github.com/repos/google/cadvisor/stargazers","contributors_url":"https://api.github.com/repos/google/cadvisor/contributors","subscribers_url":"https://api.github.com/repos/google/cadvisor/subscribers","subscription_url":"https://api.github.com/repos/google/cadvisor/subscription","commits_url":"https://api.github.com/repos/google/cadvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/cadvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/cadvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/cadvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/cadvisor/contents/{+path}","compare_url":"https://api.github.com/repos/google/cadvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/cadvisor/merges","archive_url":"https://api.github.com/repos/google/cadvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/cadvisor/downloads","issues_url":"https://api.github.com/repos/google/cadvisor/issues{/number}","pulls_url":"https://api.github.com/repos/google/cadvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/google/cadvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/google/cadvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/cadvisor/labels{/name}","releases_url":"https://api.github.com/repos/google/cadvisor/releases{/id}","created_at":"2014-06-09T16:36:33Z","updated_at":"2015-03-02T17:03:14Z","pushed_at":"2015-03-02T16:22:27Z","git_url":"git://github.com/google/cadvisor.git","ssh_url":"git@github.com:google/cadvisor.git","clone_url":"https://github.com/google/cadvisor.git","svn_url":"https://github.com/google/cadvisor","homepage":"","size":20283,"stargazers_count":1925,"watchers_count":1925,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":189,"mirror_url":null,"open_issues_count":35,"forks":189,"open_issues":35,"watchers":1925,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/cadvisor/pulls/549"},"html":{"href":"https://github.com/google/cadvisor/pull/549"},"issue":{"href":"https://api.github.com/repos/google/cadvisor/issues/549"},"comments":{"href":"https://api.github.com/repos/google/cadvisor/issues/549/comments"},"review_comments":{"href":"https://api.github.com/repos/google/cadvisor/pulls/549/comments"},"review_comment":{"href":"https://api.github.com/repos/google/cadvisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/cadvisor/pulls/549/commits"},"statuses":{"href":"https://api.github.com/repos/google/cadvisor/statuses/b671a79d6a6ab460f86c198e31bba2e3f722a6dd"}}}}