Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

4904 add hint if launcher fails, more reliable port available check #5525

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion programs/eosio-launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ launcher_def::initialize (const variables_map &vmap) {

stage = bfs::path(erd);
if (!bfs::exists(stage)) {
cerr << erd << " is not a valid path" << endl;
cerr << "\"" << erd << "\" is not a valid path. Please ensure environment variable EOSIO_HOME is set to the build path." << endl;
exit (-1);
}
stage /= bfs::path("staging");
Expand Down
12 changes: 8 additions & 4 deletions tests/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ def launch(self, pnodes=1, totalNodes=1, prodCount=1, topo="mesh", p2pPlugin="ne
assert(isinstance(totalProducers, (str,int)))
producerFlag="--producers %s" % (totalProducers)

if not Cluster.arePortsAvailable(set(range(self.port, self.port+totalNodes+1))):
Utils.Print("ERROR: Another process is listening on nodeos default port.")
return False
tries = 30
while not Cluster.arePortsAvailable(set(range(self.port, self.port+totalNodes+1))):
Utils.Print("ERROR: Another process is listening on nodeos default port. wait...")
if tries == 0:
return False
tries = tries - 1
time.sleep(2)

cmd="%s -p %s -n %s -s %s -d %s -i %s -f --p2p-plugin %s %s" % (
Utils.EosLauncherPath, pnodes, totalNodes, topo, delay, datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3],
Expand All @@ -147,7 +151,7 @@ def launch(self, pnodes=1, totalNodes=1, prodCount=1, topo="mesh", p2pPlugin="ne
s=" ".join(cmdArr)
if Utils.Debug: Utils.Print("cmd: %s" % (s))
if 0 != subprocess.call(cmdArr):
Utils.Print("ERROR: Launcher failed to launch.")
Utils.Print("ERROR: Launcher failed to launch. failed cmd: %s" % (s))
return False

self.nodes=list(range(totalNodes)) # placeholder for cleanup purposes only
Expand Down