{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/node-problem-detector/issues/3","repository_url":"https://api.github.com/repos/kubernetes/node-problem-detector","labels_url":"https://api.github.com/repos/kubernetes/node-problem-detector/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/node-problem-detector/issues/3/comments","events_url":"https://api.github.com/repos/kubernetes/node-problem-detector/issues/3/events","html_url":"https://github.com/kubernetes/node-problem-detector/issues/3","id":155385631,"number":3,"title":"KernelMonitor: Reconsider whether to use hpcloud/tail","user":{"login":"Random-Liu","id":5821883,"avatar_url":"https://avatars.githubusercontent.com/u/5821883?v=3","gravatar_id":"","url":"https://api.github.com/users/Random-Liu","html_url":"https://github.com/Random-Liu","followers_url":"https://api.github.com/users/Random-Liu/followers","following_url":"https://api.github.com/users/Random-Liu/following{/other_user}","gists_url":"https://api.github.com/users/Random-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/Random-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Random-Liu/subscriptions","organizations_url":"https://api.github.com/users/Random-Liu/orgs","repos_url":"https://api.github.com/users/Random-Liu/repos","events_url":"https://api.github.com/users/Random-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/Random-Liu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-17T23:28:34Z","updated_at":"2016-09-12T17:48:16Z","closed_at":null,"body":"For move fast as soon as possible, we used https://github.com/hpcloud/tail for the first version.\r\nHowever, in fact it has been proved to have some bugs, such as https://github.com/hpcloud/tail/issues/21.\r\n\r\nWe should reconsider whether we should try to fix the bugs or implement a simple tail lib ourselves based on https://github.com/google/cadvisor/pull/1264.\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/node-problem-detector/issues/comments/246431485","html_url":"https://github.com/kubernetes/node-problem-detector/issues/3#issuecomment-246431485","issue_url":"https://api.github.com/repos/kubernetes/node-problem-detector/issues/3","id":246431485,"user":{"login":"Random-Liu","id":5821883,"avatar_url":"https://avatars.githubusercontent.com/u/5821883?v=3","gravatar_id":"","url":"https://api.github.com/users/Random-Liu","html_url":"https://github.com/Random-Liu","followers_url":"https://api.github.com/users/Random-Liu/followers","following_url":"https://api.github.com/users/Random-Liu/following{/other_user}","gists_url":"https://api.github.com/users/Random-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/Random-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Random-Liu/subscriptions","organizations_url":"https://api.github.com/users/Random-Liu/orgs","repos_url":"https://api.github.com/users/Random-Liu/repos","events_url":"https://api.github.com/users/Random-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/Random-Liu/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T17:48:16Z","updated_at":"2016-09-12T17:48:16Z","body":"@AdoHe One thing is that, we run 2 functions when parsing kernel log:\r\n* `getStartPoint`: This function was initially added to find the recent reboot line in the kernel log.\r\n* `watchLoop`: After finding the reboot line, in side the `watchLoop`, `tail.Tail` is called with `start=head of the reboot line` to watch and parse the following log.\r\n\r\nIn this implementation, the tail lib needs to support watch from a specific point in the file, which is not supported in the simple tail library.\r\n\r\nHowever, the logic was recently changed. We find start point based on timestamp ([`now-lookback`](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/kernelmonitor/kernel_log_watcher.go#L166-L188)). In fact we can remove the function `getStartPoint` and combine the logic into watchLoop. When receiving a new log line:\r\n* If it is older than `now-lookback`, discard it.\r\n* If not, return translate and add the log line."}}
{"actor":{"display_login":"Random-Liu"}}