diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-06-16 16:09:27 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-06-16 16:09:27 +0200 |
commit | 37d5c08ef459ac68933a3245931f480fe7619e4a (patch) | |
tree | 33b41ccbcb5fb035b96bbd1a9e2d0ec0442892b3 /cpp/src/IceGrid/WellKnownObjectsManager.cpp | |
parent | Fixed ICE-6595, potential deadlock when joining thread (diff) | |
download | ice-37d5c08ef459ac68933a3245931f480fe7619e4a.tar.bz2 ice-37d5c08ef459ac68933a3245931f480fe7619e4a.tar.xz ice-37d5c08ef459ac68933a3245931f480fe7619e4a.zip |
Fixed ICE-6594: IceGrid/replication test failure
Diffstat (limited to 'cpp/src/IceGrid/WellKnownObjectsManager.cpp')
-rw-r--r-- | cpp/src/IceGrid/WellKnownObjectsManager.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/WellKnownObjectsManager.cpp b/cpp/src/IceGrid/WellKnownObjectsManager.cpp index a92967063bf..595b3fe5de0 100644 --- a/cpp/src/IceGrid/WellKnownObjectsManager.cpp +++ b/cpp/src/IceGrid/WellKnownObjectsManager.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace IceGrid; -WellKnownObjectsManager::WellKnownObjectsManager(const DatabasePtr& database) : +WellKnownObjectsManager::WellKnownObjectsManager(const DatabasePtr& database) : _database(database), _initialized(false) { } @@ -55,8 +55,15 @@ WellKnownObjectsManager::registerAll(const ReplicaSessionPrx& session) // // If initialized, the endpoints and well known objects are immutable. // - session->setEndpoints(_endpoints); - session->registerWellKnownObjects(_wellKnownObjects); + try + { + session->setEndpoints(_endpoints); + session->registerWellKnownObjects(_wellKnownObjects); + } + catch(const Ice::LocalException&) + { + // The session is already gone, ignore, this will be detected by the keep alive thread. + } } void @@ -89,7 +96,7 @@ WellKnownObjectsManager::updateReplicatedWellKnownObjects() id.category = _database->getInstanceName(); ObjectInfo info; ObjectInfoSeq objects; - + Lock sync(*this); Ice::ObjectPrx replicatedClientProxy = _database->getReplicaCache().getEndpoints("Client", _endpoints["Client"]); @@ -144,7 +151,7 @@ WellKnownObjectsManager::getLocatorRegistry() return Ice::LocatorRegistryPrx::uncheckedCast(getWellKnownObjectReplicatedProxy(id, "Server")); } -Ice::ObjectPrx +Ice::ObjectPrx WellKnownObjectsManager::getWellKnownObjectReplicatedProxy(const Ice::Identity& id, const string& endpt) { try |