Skip to content

Commit

Permalink
chore!: docker log to stdout and minor logging tweaks (#951)
Browse files Browse the repository at this point in the history
* chore: error on catchup replay is just a warning

* chore(docker): redirect stderr to stdout
  • Loading branch information
lklimek authored Nov 4, 2024
1 parent 5dc3332 commit 878f270
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions DOCKER/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash


# TODO: Workaround for busy port problem happening with docker restart policy
# we are trying to start a new container but previous process still not release
# the port.
Expand All @@ -15,9 +14,9 @@ got_signal=false
# Function to handle signals and forward them to the tenderdash process
# shellcheck disable=SC2317
_forward_signal() {
echo "Caught signal! Forwarding to tenderdash process."
got_signal=true
kill -s "$1" "$child"
echo "Caught signal! Forwarding to tenderdash process."
got_signal=true
kill -s "$1" "$child"
}

# Trap signals and forward them to the tenderdash process
Expand Down Expand Up @@ -52,14 +51,14 @@ if [ ! -d "$TMHOME/config" ]; then
fi

# Start tenderdash in the background
tenderdash "$@" &
tenderdash "$@" 2>&1 &
child=$!
wait "$child"
exit_code=$?

if [ $got_signal == false ] && [ $exit_code -ne 0 ] && [ "$1" == "start" ]; then
echo "Sleeping for 10 seconds as workaround for the busy port problem. See entrypoint code for details."
sleep 10
echo "Sleeping for 10 seconds as workaround for the busy port problem. See entrypoint code for details."
sleep 10
fi

exit $exit_code
2 changes: 1 addition & 1 deletion internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func (cs *State) OnStart(ctx context.Context) error {
break LOOP

case !IsDataCorruptionError(err):
cs.logger.Error("error on catchup replay; proceeding to start state anyway", "err", err)
cs.logger.Warn("error on catchup replay; proceeding to start state anyway", "err", err)
break LOOP

case repairAttempted:
Expand Down

0 comments on commit 878f270

Please sign in to comment.