From e90f60bcc31026a1925f287c8fb0cb45bc50e2a9 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 26 Sep 2023 11:57:38 -0500 Subject: [PATCH 1/3] Interop binaries: wait for database to be up --- interop_binaries/setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/interop_binaries/setup.sh b/interop_binaries/setup.sh index 490188d6e..614ff5f45 100755 --- a/interop_binaries/setup.sh +++ b/interop_binaries/setup.sh @@ -1,4 +1,5 @@ #!/bin/bash +until pg_isready -U postgres; do sleep 1; done /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start janus_interop_aggregator /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start aggregation_job_creator /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start aggregation_job_driver From 66a083892d375ec50e2076bc2efe58828d552a90 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 26 Sep 2023 12:34:19 -0500 Subject: [PATCH 2/3] Add timeout --- interop_binaries/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interop_binaries/setup.sh b/interop_binaries/setup.sh index 614ff5f45..ad6886356 100755 --- a/interop_binaries/setup.sh +++ b/interop_binaries/setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -until pg_isready -U postgres; do sleep 1; done +timeout 5m bash -c 'until pg_isready -U postgres; do sleep 1; done' /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start janus_interop_aggregator /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start aggregation_job_creator /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start aggregation_job_driver From cb37b6a167701fa7938eb1fb8df6254b8bdde9f9 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 26 Sep 2023 13:08:15 -0500 Subject: [PATCH 3/3] Exit on error --- interop_binaries/setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interop_binaries/setup.sh b/interop_binaries/setup.sh index ad6886356..8642700ce 100755 --- a/interop_binaries/setup.sh +++ b/interop_binaries/setup.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -e + timeout 5m bash -c 'until pg_isready -U postgres; do sleep 1; done' /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start janus_interop_aggregator /usr/bin/supervisorctl -c /etc/janus/supervisord.conf start aggregation_job_creator