8000 make scripts/startLocalCluster.sh start slightly faster (#15074) · open-bigdata/arangodb@b4e1765 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4e1765

Browse files
authored
make scripts/startLocalCluster.sh start slightly faster (arangodb#15074)
1 parent 9b3dba7 commit b4e1765

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

arangod/Agency/AgencyComm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,15 +1048,15 @@ bool AgencyComm::ensureStructureInitialized() {
10481048
break;
10491049
}
10501050

1051+
// we can get here if a competing process tries to initialize
1052+
// the agency structures as well
10511053
LOG_TOPIC("63f7b", INFO, Logger::AGENCYCOMM)
10521054
<< "Initializing agency failed. We'll try again soon";
1053-
// We should really have exclusive access, here, this is strange!
1054-
std::this_thread::sleep_for(std::chrono::seconds(1));
10551055

10561056
LOG_TOPIC("9d265", TRACE, Logger::AGENCYCOMM)
10571057
<< "Waiting for agency to get initialized";
10581058

1059-
std::this_thread::sleep_for(std::chrono::seconds(1));
1059+
std::this_thread::sleep_for(std::chrono::milliseconds(250));
10601060
}
10611061

10621062
return true;

scripts/startLocalCluster.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fi
8282

8383
SFRE=1.0
8484
COMP=500
85-
KEEP=2000
85+
KEEP=50000
8686
if [ -z "$ONGOING_PORTS" ] ; then
8787
CO_BASE=$(( $PORT_OFFSET + 8530 ))
8888
DB_BASE=$(( $PORT_OFFSET + 8629 ))
@@ -297,19 +297,25 @@ done
297297

298298
testServer() {
299299
PORT=$1
300+
COUNTER=0
300301
while true ; do
301302
if [ -z "$AUTHORIZATION_HEADER" ]; then
302303
${CURL}//$ADDRESS:$PORT/_api/version > /dev/null 2>&1
303304
else
304305
${CURL}//$ADDRESS:$PORT/_api/version -H "$AUTHORIZATION_HEADER" > /dev/null 2>&1
305306
fi
306-
if [ "$?" != "0" ] ; then
307-
echo Server on port $PORT does not answer yet.
307+
if [ "x$?" != "x0" ] ; then
308+
COUNTER=$(($COUNTER + 1))
309+
if [ "x$COUNTER" = "x4" ]; then
310+
# only print every now and then
311+
echo Server on port $PORT does not answer yet.
312+
COUNTER=0
313+
fi;
308314
else
309315
echo Server on port $PORT is ready for business.
310316
break
311317
fi
312-
sleep 1
318+
sleep 0.25
313319
done
314320
}
315321

0 commit comments

Comments
 (0)
0