mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-11-11 00:40:07 +01:00
fix: Race between signal handler and cleanup (#1350)
This commit is contained in:
1 parent
dced815c06
commit
fec4f876e7
1 file changed
+5
-2
+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