From d4b9b5646bfc66bb3dc6156fcee4af7866d8d704 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Thu, 15 Aug 2024 12:34:14 +0200 Subject: [PATCH] Stop openQA worker processes gracefully to avoid 5xx responses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this we no longer get `Stopping worker … immediately` which means that `SIGKILL` is sent to the worker process. We instead get `Stopping worker … gracefully` and only `SIGQUIT` is sent to the worker process so it can still conclude its current request. Related ticket/note: https://progress.opensuse.org/issues/162533#note-24 --- script/openqa-webui-daemon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/openqa-webui-daemon b/script/openqa-webui-daemon index 8f398df14bf..6f9c58c34ae 100755 --- a/script/openqa-webui-daemon +++ b/script/openqa-webui-daemon @@ -22,8 +22,8 @@ function start_service { # wait until openQA is ready to accept requests by waiting for its PID file while [[ ! -e $pid_file ]] && [[ -e /proc/$pid ]]; do sleep 1; done - # terminate a previously started openQA instance - [[ $pid_last ]] && kill -s TERM "$pid_last" + # terminate the previously started openQA instance gracefully + [[ $pid_last ]] && kill -s SIGQUIT "$pid_last" # keep running until openQA terminates (with the "wait"-builtin so bash can handle SIGHUP) wait "$pid"