Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we still need to use API to check whether this container is under OOM state. @sunyuan3
cc @HusterWan
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.
@allencloud How to check? I don't find other string to show the container is under OOM state expect return value.
#pouch inspect 038341
[
{
"Args": null,
"Created": "2018-06-20T09:00:04.906931671Z",
"ExecIDs": null,
"GraphDriver": {
"Data": {
"MergedDir": "",
"UpperDir": "/home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/927/fs"
},
"Name": "overlayfs"
},
"HostConfig": {
"LogConfig": {
"Type": "json-file"
},
"NetworkMode": "none",
"OomScoreAdj": -500,
"RestartPolicy": {
"Name": "no"
},
"Runtime": "runc",
"BlkioDeviceReadBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceWriteIOps": null,
"BlkioWeightDevice": null,
"CgroupParent": "default",
"DeviceCgroupRules": null,
"Devices": [],
"Memory": 4194304,
"MemoryExtra": 0,
"MemorySwappiness": -1,
"MemoryWmarkRatio": 0,
"OomKillDisable": false,
"Ulimits": null
},
"Id": "0383413d557a932dcdd006e5d731959a9dfc6f5feb6acdb50f2e36c5e03976ce",
"Image": "reg.docker.alibaba-inc.com/sunyuan/ubuntu:14.04",
"Mounts": [],
"Name": "038341",
"NetworkSettings": {
"Networks": {
"none": {
"Aliases": null,
"Links": null,
"NetworkID": "65f29c4d3becf916a635ebda8997e36e2e8acd87922c8b2466f3742563014ba1"
}
},
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
},
"Snapshotter": {
"Data": {
"MergedDir": "",
"UpperDir": "/home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/927/fs"
},
"Name": "overlayfs"
},
"State": {
"ExitCode": 137,
"FinishedAt": "2018-06-20T09:01:02.354659891Z",
"Pid": -1,
"StartedAt": "2018-06-20T09:00:05.094187175Z",
"Status": "exited"
},
"Config": {
"Cmd": [
"bash",
"-c",
"x=a; while true; do x=$x$x$x$x; done"
],
"Entrypoint": null,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Image": "reg.docker.alibaba-inc.com/sunyuan/ubuntu:14.04",
"OnBuild": null,
"Shell": null
}
}
]
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 discussed with @HusterWan offline. And currently we have no way to be noticed that a container is under OOM. in moby, there is event policy to tell users.