mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-08-28 11:56:03 +00:00
fix: Race between signal handler and cleanup (#1350)
This commit is contained in:
+5
-2
@@ -344,7 +344,7 @@ graceful_shutdown() {
|
||||
|
||||
code=$(signalCode "$sig")
|
||||
|
||||
if [ -f "$QEMU_END" ]; then
|
||||
if (( SHUTDOWN_SIGNAL != 0 )); then
|
||||
|
||||
# A second Ctrl-C is the explicit user request to skip the remaining
|
||||
# graceful-shutdown wait and proceed to forced cleanup.
|
||||
@@ -358,11 +358,14 @@ graceful_shutdown() {
|
||||
return
|
||||
fi
|
||||
|
||||
set +e
|
||||
start=$SECONDS
|
||||
SHUTDOWN_SIGNAL=$code
|
||||
|
||||
# Shutdown handlers must continue through missing processes and failed cleanup
|
||||
# commands instead of being aborted by errexit.
|
||||
set +e
|
||||
touch "$QEMU_END"
|
||||
|
||||
echo && info "Received $sig signal, sending shutdown command..."
|
||||
|
||||
if ! readQemuPid pid; then
|
||||
|
||||
Reference in New Issue
Block a user