mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-02 00:02:01 +00:00
metrics: Increase containerd start timeout
- Move `kill_kata_components` from common.bash into the metrics code base as the only user of it - Increase the timeout on the start of containerd as the last 10 nightlies metric tests have failed with: ``` 223478 Killed sudo timeout -s SIGKILL "${TIMEOUT}" systemctl start containerd ``` Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
parent
3fab7944a3
commit
658a5e032b
@ -298,23 +298,6 @@ function clean_env_ctr()
|
||||
fi
|
||||
}
|
||||
|
||||
# Kills running shim and hypervisor components
|
||||
function kill_kata_components() {
|
||||
local ATTEMPTS=2
|
||||
local TIMEOUT="30s"
|
||||
local PID_NAMES=( "containerd-shim-kata-v2" "qemu-system-x86_64" "qemu-system-x86_64-tdx-experimental" "cloud-hypervisor" )
|
||||
|
||||
sudo systemctl stop containerd
|
||||
# iterate over the list of kata components and stop them
|
||||
for (( i=1; i<=ATTEMPTS; i++ )); do
|
||||
for PID_NAME in "${PID_NAMES[@]}"; do
|
||||
[[ ! -z "$(pidof ${PID_NAME})" ]] && sudo killall -w -s SIGKILL "${PID_NAME}" >/dev/null 2>&1 || true
|
||||
done
|
||||
sleep 1
|
||||
done
|
||||
sudo timeout -s SIGKILL "${TIMEOUT}" systemctl start containerd
|
||||
}
|
||||
|
||||
# Restarts a systemd service while ensuring the start-limit-burst is set to 0.
|
||||
# Outputs warnings to stdio if something has gone wrong.
|
||||
#
|
||||
|
@ -224,6 +224,23 @@ function kill_processes_before_start()
|
||||
kill_kata_components
|
||||
}
|
||||
|
||||
# Kills running shim and hypervisor components
|
||||
function kill_kata_components() {
|
||||
local ATTEMPTS=2
|
||||
local TIMEOUT="300s"
|
||||
local PID_NAMES=( "containerd-shim-kata-v2" "qemu-system-x86_64" "qemu-system-x86_64-tdx-experimental" "cloud-hypervisor" )
|
||||
|
||||
sudo systemctl stop containerd
|
||||
# iterate over the list of kata components and stop them
|
||||
for (( i=1; i<=ATTEMPTS; i++ )); do
|
||||
for PID_NAME in "${PID_NAMES[@]}"; do
|
||||
[[ ! -z "$(pidof ${PID_NAME})" ]] && sudo killall -w -s SIGKILL "${PID_NAME}" >/dev/null 2>&1 || true
|
||||
done
|
||||
sleep 1
|
||||
done
|
||||
sudo timeout -s SIGKILL "${TIMEOUT}" systemctl start containerd
|
||||
}
|
||||
|
||||
# Generate a random name - generally used when creating containers, but can
|
||||
# be used for any other appropriate purpose
|
||||
function random_name()
|
||||
|
Loading…
Reference in New Issue
Block a user