From b2d356c3333ec09fb38a96fd5d544e49c1a43ebb Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Tue, 15 Nov 2016 16:48:48 +0100 Subject: Fix updating runtime properties for services using shared communicator --- cpp/src/IceGrid/ServerI.cpp | 17 ++++++++++++++++- cpp/test/IceGrid/noRestartUpdate/AllTests.cpp | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'cpp') diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 40f68962228..7ce139df955 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -341,7 +341,22 @@ private: { assert(_p->first.find("config_") == 0); const string service = _p->first.substr(7); - facet = "IceBox.Service." + service + ".Properties"; + bool useSharedCommunicator = false; + for (PropertyDescriptorSeq::const_iterator d = _properties.at("config").begin(); d != _properties.at("config").end(); ++d) + { + if (d->name == "IceBox.UseSharedCommunicator." + service) + { + useSharedCommunicator = (atoi(d->value.c_str()) > 0); + } + } + if (useSharedCommunicator) + { + facet = "IceBox.SharedCommunicator.Properties"; + } + else + { + facet = "IceBox.Service." + service + ".Properties"; + } if(_traceLevels->server > 1) { const string id = _server->getId(); diff --git a/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp b/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp index f0bf89f6f65..678534f6485 100644 --- a/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp +++ b/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp @@ -565,6 +565,9 @@ allTests(const Ice::CommunicatorPtr& communicator) service->name = "Service2"; icebox->services[1].descriptor = ServiceDescriptorPtr::dynamicCast(service->ice_clone()); service->name = "Service3"; + // Test also with shared communicator because it uses different proxy name + // and thus different branches in code. + addProperty(icebox, "IceBox.UseSharedCommunicator.Service3", "1"); icebox->services[2].descriptor = ServiceDescriptorPtr::dynamicCast(service->ice_clone()); try -- cgit v1.2.3