Skip to content

Commit 7e1bf5c

Browse files
abdosisanthosh-kt
authored andcommitted
Fix unwanted python exception in syslog during database container (sonic-net#5227)
startup when doing redis PING since database_config.json getting generated from jinja2 template is still not ready. Signed-off-by: Abhishek Dosi <[email protected]>
1 parent 978bfe0 commit 7e1bf5c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

files/build_templates/docker_image_ctl.j2

+7-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@ function postStartAction()
9595
link_namespace $DEV
9696
fi
9797

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

0 commit comments

Comments
 (0)