-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt the event message regex in the OOM tracker #1579
Conversation
@@ -42,7 +42,7 @@ const ( | |||
) | |||
|
|||
var ( | |||
oomEventMsgRegex = regexp.MustCompile(`Kill process (\d+) \((.+)\) score \d+ or sacrifice child\nKilled process \d+ .+ total-vm:(\d+kB), anon-rss:\d+kB, file-rss:\d+kB.*`) | |||
oomEventMsgRegex = regexp.MustCompile(`Killed process (\d+) \((.+)\) total-vm:(\d+kB), anon-rss:\d+kB, file-rss:\d+kB.*`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we try to have both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow but here's the context: kubernetes/node-problem-detector#480 (comment).
Basically, I'm adapting the regex to handle OOM events emitted by both the old and the new NPD here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are replacing Kill
with Killed
it would not work with old NPD/kernel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will - I'm simply removing the prefix of the message we observe in the NPD's kernel monitor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I did not notice the second part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some unit tests? Old kernel message and new message, so that future changes would not break it. It could be in another commit so it would be easier to backport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will open a separate PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As backports already have merged, ok.
IIUC, the new method will be backward compatible, i.e. it will also work for old NPD releases. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mm4tt, tosi3k The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Exactly. OOM tracker searches for the substring match of the regex, not for an exact match, so both formats will be covered. |
/hold cancel |
/hold |
/unhold |
Get rid of
Kill process <PID> (<PROCESS_NAME>) score 0 or sacrifice child\n
part of the OOM event message regex as it's no longer printed out in the kernel logs./sig scalability
/assign @jkaniuk