Fix logging race condition in 2 scripts#79
Merged
mwunderl merged 1 commit intofeature/non-interactivefrom Apr 30, 2026
Merged
Conversation
2cca6a3 to
d44d444
Compare
- 049, 070: chmod after exec > >(tee ...) races with file creation. Fix: touch + chmod before exec (070), simplify log setup (049). - 049: set -e + exec > >(tee) causes SIGPIPE exit. Fix: drop set -e, script already has explicit error handling via check_error. - 049: empty TEMP_FILES array triggers set -u. Fix: safe expansion. Tested locally: both scripts create and clean up resources successfully.
d44d444 to
129a5a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two scripts had
chmodafterexec > >(tee ...), creating a race where chmod runs before tee creates the file.Fix:
touch+chmodbeforeexecredirect.Scripts fixed:
Root cause: Process substitution
>(tee -a "$LOG_FILE")creates the file asynchronously.chmod 600 "$LOG_FILE"on the next line can execute before the file exists, causing intermittent failures in Fargate.