From 28d24497a3433d96ea7e9490b563308efaf0c195 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 13 Jul 2018 12:17:39 -0700 Subject: [PATCH] Wait for the leader to initialize before starting the validators --- ci/refresh-testnet.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ci/refresh-testnet.sh b/ci/refresh-testnet.sh index 2f7fd89cd834ee..5d8f433851a7d9 100755 --- a/ci/refresh-testnet.sh +++ b/ci/refresh-testnet.sh @@ -31,7 +31,7 @@ done < <(gcloud compute instances list --filter="labels.testnet-mode=validator" echo "--- Refreshing" -nodeConfig="mode=leader+drone enable-cuda=1 metrics-config=$SOLANA_METRICS_CONFIG" +leader=true for info in "${vmlist[@]}"; do vmName=${info%:*} vmZone=${info#*:} @@ -39,6 +39,11 @@ for info in "${vmlist[@]}"; do ( echo "--- Processing $vmName in zone $vmZone" + if $leader; then + nodeConfig="mode=leader+drone enable-cuda=1 metrics-config=$SOLANA_METRICS_CONFIG" + else + nodeConfig="mode=validator metrics-config=$SOLANA_METRICS_CONFIG" + fi cat > "autogen-refresh-$vmName.sh" < "log-$vmName.txt" 2>&1 & - nodeConfig="mode=validator metrics-config=$SOLANA_METRICS_CONFIG" + + if $leader; then + echo Waiting for leader... + # Wait for the leader to initialize before starting the validators + # TODO: Remove this limitation eventually. + wait + fi + leader=false done -echo "Waiting..." +echo Waiting for validators... wait for info in "${vmlist[@]}"; do