From d22093f5979b01e70dcdaae085317bd88f16c0fc Mon Sep 17 00:00:00 2001 From: nobodyiam Date: Tue, 6 Dec 2016 22:37:52 +0800 Subject: [PATCH] add max-time option to avoid unexpected hang --- apollo-adminservice/src/main/scripts/startup.sh | 2 +- apollo-configservice/src/main/scripts/startup.sh | 2 +- apollo-portal/src/main/scripts/startup.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apollo-adminservice/src/main/scripts/startup.sh b/apollo-adminservice/src/main/scripts/startup.sh index 69d6de09cca..9e4c44c4fd4 100644 --- a/apollo-adminservice/src/main/scripts/startup.sh +++ b/apollo-adminservice/src/main/scripts/startup.sh @@ -66,7 +66,7 @@ declare -i max_counter=16 # 16*5=80s declare -i total_time=0 printf "Waiting for server startup" >> $STARTUP_LOG -until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --head $SERVER_URL | grep "Coyote")" != "" ]]; +until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --max-time 2 --head $SERVER_URL | grep "Coyote")" != "" ]]; do printf "." >> $STARTUP_LOG counter+=1 diff --git a/apollo-configservice/src/main/scripts/startup.sh b/apollo-configservice/src/main/scripts/startup.sh index a80a977ae27..087e69676f5 100644 --- a/apollo-configservice/src/main/scripts/startup.sh +++ b/apollo-configservice/src/main/scripts/startup.sh @@ -66,7 +66,7 @@ declare -i max_counter=16 # 16*5=80s declare -i total_time=0 printf "Waiting for server startup" >> $STARTUP_LOG -until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --head $SERVER_URL | grep "Coyote")" != "" ]]; +until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --max-time 2 --head $SERVER_URL | grep "Coyote")" != "" ]]; do printf "." >> $STARTUP_LOG counter+=1 diff --git a/apollo-portal/src/main/scripts/startup.sh b/apollo-portal/src/main/scripts/startup.sh index 5805f827336..1a52ece1cf2 100644 --- a/apollo-portal/src/main/scripts/startup.sh +++ b/apollo-portal/src/main/scripts/startup.sh @@ -66,7 +66,7 @@ declare -i max_counter=16 # 16*5=80s declare -i total_time=0 printf "Waiting for server startup" >> $STARTUP_LOG -until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --head $SERVER_URL | grep "Coyote")" != "" ]]; +until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --max-time 2 --head $SERVER_URL | grep "Coyote")" != "" ]]; do printf "." >> $STARTUP_LOG counter+=1