summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/NodeSessionManager.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2011-04-07 13:48:24 +0200
committerBenoit Foucher <benoit@zeroc.com>2011-04-07 13:48:24 +0200
commit397efc73c7a3c2660b6cb567a13a9a87d2c388e9 (patch)
tree68d2888101b951bb582b1d60c61fc75ba4328010 /cpp/src/IceGrid/NodeSessionManager.cpp
parentBug 4720 - Improved AsyncResult to allow throwing local exception is request ... (diff)
downloadice-397efc73c7a3c2660b6cb567a13a9a87d2c388e9.tar.bz2
ice-397efc73c7a3c2660b6cb567a13a9a87d2c388e9.tar.xz
ice-397efc73c7a3c2660b6cb567a13a9a87d2c388e9.zip
Fixed bug 4818 - IceGrid node startup hang
Diffstat (limited to 'cpp/src/IceGrid/NodeSessionManager.cpp')
-rw-r--r--cpp/src/IceGrid/NodeSessionManager.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/NodeSessionManager.cpp b/cpp/src/IceGrid/NodeSessionManager.cpp
index 49a5038e150..0863039e950 100644
--- a/cpp/src/IceGrid/NodeSessionManager.cpp
+++ b/cpp/src/IceGrid/NodeSessionManager.cpp
@@ -67,6 +67,11 @@ NodeSessionKeepAliveThread::createSession(InternalRegistryPrx& registry, IceUtil
{
for(vector<QueryPrx>::const_iterator p = _queryObjects.begin(); p != _queryObjects.end(); ++p)
{
+ if(isDestroyed())
+ {
+ break;
+ }
+
InternalRegistryPrx newRegistry;
try
{
@@ -245,7 +250,7 @@ NodeSessionManager::create(const NodeIPtr& node)
// with replicas (see createdSession below) and this must be done
// before the node is activated.
//
- _thread->tryCreateSession(true);
+ _thread->tryCreateSession(true, IceUtil::Time::seconds(3));
}
void
@@ -284,11 +289,6 @@ NodeSessionManager::activate()
// replica observer is set on the session.
//
NodeSessionPrx session = _thread->getSession();
- if(!session)
- {
- _thread->tryCreateSession(true);
- session = _thread->getSession();
- }
if(session)
{
try
@@ -531,6 +531,11 @@ NodeSessionManager::createdSession(const NodeSessionPrx& session)
map<Ice::Identity, Ice::ObjectPrx> proxies;
for(vector<QueryPrx>::const_iterator p = _queryObjects.begin(); p != _queryObjects.end(); ++p)
{
+ if(isDestroyed())
+ {
+ return;
+ }
+
try
{
Ice::ObjectProxySeq prxs = (*p)->findAllObjectsByType(InternalRegistry::ice_staticId());
@@ -591,6 +596,10 @@ NodeSessionManager::createdSession(const NodeSessionPrx& session)
//
for(vector<NodeSessionKeepAliveThreadPtr>::const_iterator p = sessions.begin(); p != sessions.end(); ++p)
{
+ if(isDestroyed())
+ {
+ return;
+ }
(*p)->tryCreateSession(true, IceUtil::Time::seconds(5));
}
}