From 9b44664537e6e27528ee6189d82aa6b0e21f9849 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2004 16:31:52 +0000 Subject: [PATCH] removed unnecesary check in ConfigInfo added retries to tryBind ndb/src/common/mgmcommon/ConfigInfo.cpp: removed unnecesary check in ConfigInfo ndb/src/mgmsrv/main.cpp: added retries to tryBind --- ndb/src/common/mgmcommon/ConfigInfo.cpp | 4 +--- ndb/src/mgmsrv/main.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/mgmcommon/ConfigInfo.cpp b/ndb/src/common/mgmcommon/ConfigInfo.cpp index 27db9805936..861e38d8c09 100644 --- a/ndb/src/common/mgmcommon/ConfigInfo.cpp +++ b/ndb/src/common/mgmcommon/ConfigInfo.cpp @@ -3118,9 +3118,7 @@ check_node_vs_replicas(Vector§ions, { Uint32 db_nodes = 0; Uint32 replicas = 0; - if (!ctx.m_userProperties.get("DB", &db_nodes)) { - return true; - } + ctx.m_userProperties.get("DB", &db_nodes); ctx.m_userProperties.get("NoOfReplicas", &replicas); if((db_nodes % replicas) != 0){ ctx.reportError("Invalid no of db nodes wrt no of replicas.\n" diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 86fbaa848f9..e8624ee5647 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -180,7 +180,12 @@ NDB_MAIN(mgmsrv){ glob.use_specific_ip = false; if(!glob.use_specific_ip){ - if(!glob.socketServer->tryBind(glob.port, glob.interface_name)){ + int count= 5; // no of retries for tryBind + while(!glob.socketServer->tryBind(glob.port, glob.interface_name)){ + if (--count > 0) { + NdbSleep_MilliSleep(1000); + continue; + } ndbout_c("Unable to setup port: %s:%d!\n" "Please check if the port is already used,\n" "(perhaps a ndb_mgmd is already running),\n"