summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-02-06 15:08:37 +0100
committerBenoit Foucher <benoit@zeroc.com>2017-02-06 15:08:37 +0100
commitc28648f6e1a35cdbf5b4b6e2c3b93511a1823726 (patch)
tree279646e29dab3a08ae0cc5073188c50ed775f098 /cpp
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-c28648f6e1a35cdbf5b4b6e2c3b93511a1823726.tar.bz2
ice-c28648f6e1a35cdbf5b4b6e2c3b93511a1823726.tar.xz
ice-c28648f6e1a35cdbf5b4b6e2c3b93511a1823726.zip
Fixed ICE-7558 - Reduce chances to lose datagrams by tuning the buffer size and adding dedicated thread pools
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/IceStorm/single/Subscriber.cpp6
-rw-r--r--cpp/test/IceStorm/single/test.py7
2 files changed, 9 insertions, 4 deletions
diff --git a/cpp/test/IceStorm/single/Subscriber.cpp b/cpp/test/IceStorm/single/Subscriber.cpp
index db3365f4f7c..802bd5d83c4 100644
--- a/cpp/test/IceStorm/single/Subscriber.cpp
+++ b/cpp/test/IceStorm/single/Subscriber.cpp
@@ -207,23 +207,25 @@ run(int, char* argv[], const CommunicatorPtr& communicator)
// Use a separate adapter to ensure a separate connection is used for the subscriber
// (otherwise, if multiple UDP subscribers use the same connection we might get high
// packet loss, see bug 1784).
+ communicator->getProperties()->setProperty("UdpAdapter3.ThreadPool.Size", "1");
ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdapter3", "udp");
subscribers.push_back(new SingleI(communicator, "datagram"));
Ice::ObjectPrx object = adpt->addWithUUID(subscribers.back())->ice_datagram();
subscriberIdentities.push_back(object->ice_getIdentity());
- topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
adpt->activate();
+ topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
}
{
// Use a separate adapter to ensure a separate connection is used for the subscriber
// (otherwise, if multiple UDP subscribers use the same connection we might get high
// packet loss, see bug 1784).
+ communicator->getProperties()->setProperty("UdpAdapter4.ThreadPool.Size", "1");
ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("UdpAdapter4", "udp");
subscribers.push_back(new SingleI(communicator, "batch datagram"));
Ice::ObjectPrx object = adpt->addWithUUID(subscribers.back())->ice_batchDatagram();
subscriberIdentities.push_back(object->ice_getIdentity());
- topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
adpt->activate();
+ topic->subscribeAndGetPublisher(IceStorm::QoS(), object);
}
adapter->activate();
diff --git a/cpp/test/IceStorm/single/test.py b/cpp/test/IceStorm/single/test.py
index b4e5848e2b0..73f876d3016 100644
--- a/cpp/test/IceStorm/single/test.py
+++ b/cpp/test/IceStorm/single/test.py
@@ -15,12 +15,15 @@
# send buffer size (causing the received messages to be
# truncated). See also bug #6070.
#
-props = { "Ice.UDP.SndSize" : 4096, "Ice.Warn.Dispatch" : 0 }
+# We also reduce the chances of loosing datagrams by configuring a send
+# buffer size inferior to the receive buffer size (bug #7558).
+#
+props = { "Ice.UDP.SndSize" : 2048, "Ice.Warn.Dispatch" : 0 }
persistent = IceStorm(props = props)
transient = IceStorm(props = props, transient=True)
replicated = [ IceStorm(replica=i, nreplicas=3, props = props) for i in range(0,3) ]
-sub = Subscriber(args=["{testcase.parent.name}"], props = { "Ice.UDP.RcvSize" : 4096 }, readyCount=3)
+sub = Subscriber(args=["{testcase.parent.name}"], props = { "Ice.UDP.RcvSize" : 4096 }, readyCount=2)
pub = Publisher(args=["{testcase.parent.name}"])
class IceStormSingleTestCase(IceStormTestCase):