Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhut committed Dec 3, 2018
1 parent 217fd9e commit 46a629e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rest-server/src/templates/yarnContainerScript.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ function exit_handler()
docker logs $docker_name
docker inspect $docker_name
pid=$(docker inspect --format={{{ inspectPidFormat }}} $docker_name 2>/dev/null)
if [ $pid ]; then
if [ $pid -gt 0 ]; then
kill -9 $pid &&\
debug_log "$handler" "docker caontainer $docker_name killed successfully." ||\
debug_log "$handler" "tries to kill the container $docker_name but failed. Maybe it has already exited."
else
debug_log "$handler" "docker container $docker_name has already exited"
is_oom=$(docker inspect --format={{{ inspectOOMKilledFormat }}} $docker_name 2>/dev/null)
debug_log "$handler" "docker container $docker_name is exited by OOM? $is_oom"
if [ "$is_oom" -eq "true" ]; then
if [ "$is_oom" = "true" ]; then
is_cgroup_oom=$(dmesg | grep "Memory cgroup out of memory: Kill $docker_pid")
debug_log "$handler" "docker container $docker_name is exited by cgroup OOM? $is_cgroup_oom"
if [ -n "$is_cgroup_oom" ]; then
Expand Down Expand Up @@ -323,4 +323,4 @@ docker_pid=$(docker inspect --format "{{{ inspectPidFormat }}}" $docker_name)

echo "Docker container pid is $docker_pid"

docker attach $docker_name
docker attach --no-stdin $docker_name

0 comments on commit 46a629e

Please sign in to comment.