Archived
This forum has been archived. Please start a new discussion on GitHub.
Icepack registry "TimeOut" exception with heavy load
We've got two servers, each deploys a icepacknode which manages it's local service. Only one icepackregistry is used. We increase concurrent client number gradually and when exceeds some number, checkedCast throw Timeout Exception
==============
statement :
query =
IcePack::QueryPrx::checkedCast(ic->
stringToProxy
("IcePack/Query"));
Exception:
ConnectionI.cpp:127: Ice::ConnectTimeoutException:
timeout while establishing a connection
==============
original code is following:
when a server is down, the error will appear more quickly.
==============
statement :
query =
IcePack::QueryPrx::checkedCast(ic->
stringToProxy
("IcePack/Query"));
Exception:
ConnectionI.cpp:127: Ice::ConnectTimeoutException:
timeout while establishing a connection
==============
original code is following:
for (i = 0; i < 2; i++) {
Ice::PropertiesPtr props1 = Ice::createProperties();
props1->setProperty("Ice.Default.Locator",
"IcePack/Locator:default -p 12000 -t 100 -h "
+ reg[i]);
props1->setProperty("IcePack.Registry.Client.Endpoints",
"default -p 12000 -t 100 -h " + reg[i]);
props1->setProperty("Ice.MessageSizeMax", "102400");
props1->setProperty("Ice.Warn.Leaks", "0");
try
{
ic = Ice::initializeWithProperties(argc, argv, props1);
}
catch(const Ice::ConnectTimeoutException &ex){
errorStr = ex.ice_name();
continue;
}
try {
query =
IcePack::QueryPrx::checkedCast(ic->
stringToProxy
("IcePack/Query"));
int j = 0;
registerflag = true;
for (j = 0; j < 20; j++) {
try {
base =
query->
findObjectByType("::NetDB::MBatchStatement");
batch = MBatchStatementPrx::checkedCast(base);
if (batch) {
flag = true;
break;
}
}
catch(const Ice::Exception & ex) {
cout <<"service========"<< ex << endl;
}
}
if (j != 20)
break;
}
catch(const Ice::Exception & ex) {
errorStr = ex.ice_name();
cerr<<"registry=========="<<ex<<endl;
ic->destroy();
}
}
when a server is down, the error will appear more quickly.
0
Comments
-
You have the timeout set to 100ms, which isn't a very long time -- especially once the server gets loaded... What do you find suprising in this scenario?0