Skip to content

Commit

Permalink
Fix unwanted python exception in syslog during database container (#5227
Browse files Browse the repository at this point in the history
)

startup when doing redis PING since database_config.json getting
generated from jinja2 template is still not ready.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
  • Loading branch information
abdosi authored Aug 21, 2020
1 parent 570dbf5 commit 1a805e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ function postStartAction()
link_namespace $DEV
fi

# Wait until redis starts
until [[ $($SONIC_DB_CLI PING | grep -c PONG) -gt 0 ]]; do
# Wait until supervisord and redis starts. This change is needed
# because now database_config.json is jinja2 templated based
# and by the time file gets generated if we do redis ping
# then we catch python exception of file not valid
# that comes to syslog which is unwanted so wait till database
# config is ready and then ping
until [[ ($(docker exec -i database$DEV pgrep -x -c supervisord) -gt 0) && ($($SONIC_DB_CLI PING | grep -c PONG) -gt 0) ]]; do
sleep 1;
done

Expand Down

0 comments on commit 1a805e7

Please sign in to comment.