Detect and kill hung vim process

There is a specific scenario when vim starts where threads keep
stalled and then after 600s the subsystems are marked as not sane.
In this situation vim is supposed to quit, but instead it stays
alive but in a failed state.

This commit adds an extra step in vim monitoring ocf script to
test if vim rpc port is open and responding, and if not, vim
is forcefully killed.

Test Plan
PASS: install/bootstrap/unlock AIO-SX
PASS: get vim to a not-sane state and observe it being killed
      and restarted in this scenario

Closes-bug: 1979992
Change-Id: I55777a0858507634a362e58b9da281492809a03d
Signed-off-by: Heitor Matsui <HeitorVieira.Matsui@windriver.com>
This commit is contained in:
Heitor Matsui 2022-06-28 11:45:04 -03:00
parent cafb8f15c0
commit fc1aff636d
1 changed files with 9 additions and 0 deletions

View File

@ -145,6 +145,15 @@ vim_status() {
return $OCF_NOT_RUNNING
fi
ocf_run nc -z -v -w 15 localhost 4343 >/dev/null 2>&1
rc=$?
if [ $rc -ne 0 ]; then
ocf_log info "VIM is running but not responding"
vim_confirm_stop
rm -f $OCF_RESKEY_pid
return $OCF_ERR_GENERIC
fi
return $OCF_SUCCESS
}