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 | |
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
-rw-r--r-- | cpp/src/IceGrid/ServerCache.cpp | 11 | ||||
-rw-r--r-- | cpp/src/IceGrid/WellKnownObjectsManager.cpp | 17 |
2 files changed, 19 insertions, 9 deletions
diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp index d6a320b68eb..4d998e9ab17 100644 --- a/cpp/src/IceGrid/ServerCache.cpp +++ b/cpp/src/IceGrid/ServerCache.cpp @@ -133,12 +133,15 @@ ServerEntryPtr ServerCache::add(const ServerInfo& info) { Lock sync(*this); - assert(!getImpl(info.descriptor->id)); - - ServerEntryPtr entry = new ServerEntry(*this, info.descriptor->id); - addImpl(info.descriptor->id, entry); + ServerEntryPtr entry = getImpl(info.descriptor->id); + if(!entry) + { + entry = new ServerEntry(*this, info.descriptor->id); + addImpl(info.descriptor->id, entry); + } entry->update(info, false); + _nodeCache.get(info.node, true)->addServer(entry); forEachCommunicator(AddCommunicator(*this, entry, info.application))(info.descriptor); 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 |