summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/RetryQueue.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-10-15 17:26:45 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-10-15 17:26:45 +0200
commitf94eb5f938d33dc2ce9b09b03b5dc6ccf7bd46c2 (patch)
tree6b12ef2c59421702743048393f4757c0d1e0c504 /cpp/src/Ice/RetryQueue.cpp
parentICE-5732 missing tracing in throughput demo (diff)
downloadice-f94eb5f938d33dc2ce9b09b03b5dc6ccf7bd46c2.tar.bz2
ice-f94eb5f938d33dc2ce9b09b03b5dc6ccf7bd46c2.tar.xz
ice-f94eb5f938d33dc2ce9b09b03b5dc6ccf7bd46c2.zip
Fixed ICE-5666: setting the invocation timeout to -2 provides the previous connection timeouts
Diffstat (limited to 'cpp/src/Ice/RetryQueue.cpp')
-rw-r--r--cpp/src/Ice/RetryQueue.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/cpp/src/Ice/RetryQueue.cpp b/cpp/src/Ice/RetryQueue.cpp
index fe0e03d980f..063f413c80a 100644
--- a/cpp/src/Ice/RetryQueue.cpp
+++ b/cpp/src/Ice/RetryQueue.cpp
@@ -44,16 +44,14 @@ IceInternal::RetryTask::requestCanceled(OutgoingBase*, const Ice::LocalException
}
void
-IceInternal::RetryTask::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, const Ice::LocalException&)
+IceInternal::RetryTask::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, const Ice::LocalException& ex)
{
if(_queue->cancel(this))
{
- //
- // We just retry the outgoing async now rather than marking it
- // as finished. The retry will check for the cancellation
- // exception and terminate appropriately the request.
- //
- _outAsync->retry();
+ if(_outAsync->completed(ex))
+ {
+ _outAsync->invokeCompletedAsync();
+ }
}
}
@@ -89,6 +87,7 @@ IceInternal::RetryQueue::add(const ProxyOutgoingAsyncBasePtr& out, int interval)
throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
RetryTaskPtr task = new RetryTask(this, out);
+ out->cancelable(task); // This will throw if the request is canceled.
try
{
_instance->timer()->schedule(task, IceUtil::Time::milliSeconds(interval));
@@ -98,7 +97,6 @@ IceInternal::RetryQueue::add(const ProxyOutgoingAsyncBasePtr& out, int interval)
throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
_requests.insert(task);
- out->cancelable(task);
}
void