Error Handling: How set -euo pipefail Really Behaves, trap, Cleanup, Retry and Locking
set -e does not act on commands whose result is used as a condition, nor inside functions called in such conditions; local x=$(...), command substitution and (( count++ )) surprise too. We add set -Eeuo pipefail, an ERR trap that logs a call stack, an EXIT trap that leaves no half-done folder, retries, timeout, a single-deploy lock with flock and a flow that is safe to run twice to Bookstore's deploy script.
15 Nov 2026
·
17 min
·
6