From d8fcf53355e0a473532140de6736af4db92975eb Mon Sep 17 00:00:00 2001 From: wenweihuang Date: Wed, 28 Aug 2024 12:51:01 +0800 Subject: [PATCH] [INLONG-10889][Agent] When the oom is detected, the process exits --- inlong-agent/bin/oom.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/inlong-agent/bin/oom.sh b/inlong-agent/bin/oom.sh index 6fcc09e8207..ff26029165f 100755 --- a/inlong-agent/bin/oom.sh +++ b/inlong-agent/bin/oom.sh @@ -46,6 +46,7 @@ function stop_agent() { (( count++ )) time=$(date "+%Y-%m-%d %H:%M:%S") pid=$(ps -aux | grep 'java' | grep 'inlong-agent' | grep "$check_agent_uniq" | awk '{print $2}') + echo "$time oom stopping agent($pid) $count times" >> $CONSOLE_OUTPUT_FILE if [ "${count}" -gt 10 ]; then echo "$time oom kill -9 $pid" >> $CONSOLE_OUTPUT_FILE kill -9 "${pid}"