change default oom victim container name#2160
Conversation
|
Hi @gaorong. Thanks for your PR. I'm waiting for a google or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/assign @vmarmol |
|
/ok-to-test |
5a8b292 to
4072895
Compare
|
the CI is green now |
|
/lgtm |
background
In kubernetes, kubelet subscribes to cadvisor and follow the OOM event, the request is as below,
kubelet's related code is here, then cadvisor will return all system oom event against this request.
what happened to me
However, when I used this request as kubernetes with the only difference is the eventType, which is
EventOomKillin mine, it seems not to work to me, I expect that cadvisor return all system oom kill event. (aside: The difference ofEventOomKillandEventOomis described here).cadvisor's behavior
When some process indeed been killed because of oom, cadvisor check if event satisfies request. In a situation described as above, cadvisor checks satisfaction and invokes
checkIfIsSubcontainer, butcheckIfIsSubcontaineralways fails, which shouldn't happen.this PR fixes this bug by initializing
OomInstance.VictimContainerNameas '/', which is the same as whatOomInstance.ContainerNamedoes. when oom parser parses kmsg's log and doesn't find a killed container, it will stay this name. and then if someone request as above, it will match this oom kill event and return this event.