Fix random kills during pre-commit image building (#11535)
Seems like the trap with several steps and || true does not really work the way I wanted and when kill is run but the process is already gone, we had error in the script. Looks like this approach with sub-process kill will do it.
This commit is contained in:
Родитель
4655409982
Коммит
bf79578ed0
|
@ -519,8 +519,8 @@ function build_images::build_ci_image() {
|
|||
" >"${DETECTED_TERMINAL}"
|
||||
spinner::spin "${OUTPUT_LOG}" &
|
||||
SPIN_PID=$!
|
||||
# shellcheck disable=SC2064
|
||||
traps::add_trap "kill ${SPIN_PID} || true" INT TERM HUP EXIT
|
||||
# shellcheck disable=SC2064,SC2016
|
||||
traps::add_trap '$(kill '${SPIN_PID}' || true)' EXIT HUP INT TERM
|
||||
fi
|
||||
push_pull_remove_images::pull_ci_images_if_needed
|
||||
if [[ "${DOCKER_CACHE}" == "disabled" ]]; then
|
||||
|
@ -557,8 +557,8 @@ function build_images::build_ci_image() {
|
|||
" >"${DETECTED_TERMINAL}"
|
||||
spinner::spin "${OUTPUT_LOG}" &
|
||||
SPIN_PID=$!
|
||||
# shellcheck disable=SC2064
|
||||
traps::add_trap "kill ${SPIN_PID} || true" EXIT HUP INT TERM
|
||||
# shellcheck disable=SC2064,SC2016
|
||||
traps::add_trap '$(kill '${SPIN_PID}' || true)' EXIT HUP INT TERM
|
||||
fi
|
||||
if [[ -n ${DETECTED_TERMINAL=} ]]; then
|
||||
echo -n "
|
||||
|
|
Загрузка…
Ссылка в новой задаче