diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-11-24 18:22:03 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-11-24 18:22:03 +0100 |
commit | 4900e45ceadf8b1acd435a6e7b9423e5fa09ebc9 (patch) | |
tree | e7b63106ecd3290a9c6eb829d47dc63530c3ec79 /cpp | |
parent | ICE-5963 - Fix C# Glacier2/sessionHelper /w ssl test failure (diff) | |
download | ice-4900e45ceadf8b1acd435a6e7b9423e5fa09ebc9.tar.bz2 ice-4900e45ceadf8b1acd435a6e7b9423e5fa09ebc9.tar.xz ice-4900e45ceadf8b1acd435a6e7b9423e5fa09ebc9.zip |
Fixed ICE-5969: IceGrid/allocation test failure
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 25 | ||||
-rw-r--r-- | cpp/test/IceGrid/allocation/AllTests.cpp | 6 |
2 files changed, 12 insertions, 19 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index ae7f9d37c36..ddcbea13f11 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -552,17 +552,6 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) } assert(acm.timeout != IceUtil::Time()); - if(static_cast<Int>(_readStream.b.size()) > headerSize || !_writeStream.b.empty()) - { - // - // If writing or reading, nothing to do, the connection - // timeout will kick-in if writes or reads don't progress. - // This check is necessary because the actitivy timer is - // only set when a message is fully read/written. - // - return; - } - // // We send a heartbeat if there was no activity in the last // (timeout / 4) period. Sending a heartbeat sooner than really @@ -575,9 +564,8 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) // per timeout period because the monitor() method is sill only // called every (timeout / 2) period. // - if(acm.heartbeat == HeartbeatAlways || - (acm.heartbeat != HeartbeatOff && now >= (_acmLastActivity + acm.timeout / 4))) + (acm.heartbeat != HeartbeatOff && _writeStream.b.empty() && now >= (_acmLastActivity + acm.timeout / 4))) { if(acm.heartbeat != HeartbeatOnInvocation || _dispatchCount > 0) { @@ -585,6 +573,17 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm) } } + if(static_cast<Int>(_readStream.b.size()) > headerSize || !_writeStream.b.empty()) + { + // + // If writing or reading, nothing to do, the connection + // timeout will kick-in if writes or reads don't progress. + // This check is necessary because the actitivy timer is + // only set when a message is fully read/written. + // + return; + } + if(acm.close != CloseOff && now >= (_acmLastActivity + acm.timeout)) { if(acm.close == CloseOnIdleForceful || diff --git a/cpp/test/IceGrid/allocation/AllTests.cpp b/cpp/test/IceGrid/allocation/AllTests.cpp index 64dba18ebcf..860c4c92e67 100644 --- a/cpp/test/IceGrid/allocation/AllTests.cpp +++ b/cpp/test/IceGrid/allocation/AllTests.cpp @@ -278,7 +278,6 @@ allTests(const Ice::CommunicatorPtr& communicator) communicator->stringToProxy(communicator->getDefaultLocator()->ice_getIdentity().category + "/Registry")); test(registry); AdminSessionPrx session = registry->createAdminSession("foo", "bar"); - session->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::HeartbeatAlways); AdminPrx admin = session->getAdmin(); @@ -306,10 +305,6 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing create session... " << flush; SessionPrx session1 = registry->createSession("Client1", ""); SessionPrx session2 = registry->createSession("Client2", ""); - - session1->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::HeartbeatOnIdle); - session2->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::HeartbeatOnIdle); - cout << "ok" << endl; cout << "testing allocate object by identity... " << flush; @@ -1050,7 +1045,6 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "stress test... " << flush; SessionPrx stressSession = registry->createSession("StressSession", ""); - stressSession->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::HeartbeatOnIdle); const int nClients = 10; int i; |