Repository navigation
Conversation
…er (semaphoreui#4280) Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Contributor
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The one-line change correctly prevents premature termination under set -e, with focused verification supporting the intended behavior.
No open issues 🎉
What changed in this PR
Fixes #4280 by allowing the Docker server wrapper to print its database connection timeout error before exiting.
Changes:
- Replaces
exprwith POSIX shell arithmetic, preventingset -efrom terminating the script when the countdown reaches zero. - Preserves the existing retry timing and timeout check.
| File | Description |
|---|---|
deployment/docker/server/server-wrapper |
Updates the timeout decrement so the database failure message is reached. |
Review effort: Balanced
This branch has not been deployed
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.
Fixes #4280.
The wrapper runs with
set -e, andexprexits with status 1 when its result is 0, so on the last retryTIMEOUT=$(expr $TIMEOUT - 1)killed the script before the-eq 0check could print "Could not connect to database server. Exiting." Using$((TIMEOUT - 1))lets the loop reach the check. I ran the wrapper with a stubbedncthat always fails under sh and dash, and the error message now prints before the exit.Summary by CodeRabbit