The dry-run cleanup trap replaced the lock-release trap and orphaned fallback.lock

This commit is contained in:
Gmer4Lfe
2026-08-22 00:24:06 -04:00
parent f8119f3786
commit 46239012b4
+6 -2
View File
@@ -936,8 +936,12 @@ dryrun_state_cleanup() {
[[ "$DRY_RUN" == true && "$FALLBACK_STATE_FILE" == *".dryrun."* ]] && rm -f "$FALLBACK_STATE_FILE"
return 0
}
trap 'dryrun_state_cleanup' EXIT
trap 'FALLBACK_RUNNING=false; warn "Fallback received shutdown signal — stopping cleanly"; dryrun_state_cleanup; exit 0' \
# Must call _release_all_locks too. acquire_lock() registers its own EXIT trap, and bash keeps
# exactly one per signal — a bare `trap ... EXIT` here silently replaced it and orphaned
# fallback.lock, which is the precise failure the _LOCK_FILES registry in common.sh was built to
# stop. The signal trap only needs `exit 0`; that fires EXIT, which does both jobs.
trap 'dryrun_state_cleanup; _release_all_locks' EXIT
trap 'FALLBACK_RUNNING=false; warn "Fallback received shutdown signal — stopping cleanly"; exit 0' \
SIGTERM SIGINT
while [[ "$FALLBACK_RUNNING" == true ]]; do