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

[runtime] fix and improvement #3093

Merged
merged 3 commits into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/rest-server/src/templates/dockerContainerScript.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ function log_runtime_error()

function sigterm_handler()
{
rc=$?
printf "[DEBUG] SIGTERM received, job will be killed\n"
log_runtime_error "ERROR" "REASON" "\"Container receive signal SIGTERM\""
exit $rc
exit 143
} 1>> $RUNTIME_DOCKER_LOG 2>> $RUNTIME_DOCKER_ERR_LOG


Expand Down
2 changes: 1 addition & 1 deletion src/rest-server/src/templates/yarnContainerScript.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function exit_handler()
# After all necessary steps, do a best effort kill here
pid=$(docker inspect --format={{{ inspectPidFormat }}} $docker_name 2>/dev/null)
if [[ -n "$pid" && "$pid" -gt 0 ]]; then
kill -15 $pid &&\
kill -15 $(ps -s $pid -o pid=) &&\
printf "[DEBUG] Docker container $docker_name killed successfully." ||\
printf "[DEBUG] Try to kill the container $docker_name but failed. Maybe it has already exited."
fi
Expand Down