summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/RetryQueue.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2015-02-27 10:17:39 -0330
committerDwayne Boone <dwayne@zeroc.com>2015-02-27 10:17:39 -0330
commit8207fb948b20c4bbe64ee21f2115420d947b0039 (patch)
tree5141cc7ba4d3902c215cf89ad3cbf40dd67e499c /cpp/src/Ice/RetryQueue.cpp
parentICE-6185 Fix .NET TraceLogger to trace errors/warnings as proper type (diff)
downloadice-8207fb948b20c4bbe64ee21f2115420d947b0039.tar.bz2
ice-8207fb948b20c4bbe64ee21f2115420d947b0039.tar.xz
ice-8207fb948b20c4bbe64ee21f2115420d947b0039.zip
ICE-5967 add cancelation to Ice.Trace.Retry tracing
Diffstat (limited to 'cpp/src/Ice/RetryQueue.cpp')
-rw-r--r--cpp/src/Ice/RetryQueue.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/cpp/src/Ice/RetryQueue.cpp b/cpp/src/Ice/RetryQueue.cpp
index bd73379646a..6cf87596708 100644
--- a/cpp/src/Ice/RetryQueue.cpp
+++ b/cpp/src/Ice/RetryQueue.cpp
@@ -11,6 +11,8 @@
#include <Ice/OutgoingAsync.h>
#include <Ice/LocalException.h>
#include <Ice/Instance.h>
+#include <Ice/TraceLevels.h>
+#include <Ice/LoggerUtil.h>
using namespace std;
using namespace Ice;
@@ -18,8 +20,12 @@ using namespace IceInternal;
IceUtil::Shared* IceInternal::upCast(RetryQueue* p) { return p; }
-IceInternal::RetryTask::RetryTask(const RetryQueuePtr& queue, const ProxyOutgoingAsyncBasePtr& outAsync) :
- _queue(queue), _outAsync(outAsync)
+IceInternal::RetryTask::RetryTask(const InstancePtr& instance,
+ const RetryQueuePtr& queue,
+ const ProxyOutgoingAsyncBasePtr& outAsync) :
+ _instance(instance),
+ _queue(queue),
+ _outAsync(outAsync)
{
}
@@ -37,7 +43,7 @@ IceInternal::RetryTask::runTimerTask()
_queue->remove(this);
}
-void
+void
IceInternal::RetryTask::requestCanceled(OutgoingBase*, const Ice::LocalException&)
{
assert(false);
@@ -48,6 +54,11 @@ IceInternal::RetryTask::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsyn
{
if(_queue->cancel(this))
{
+ if(_instance->traceLevels()->retry >= 1)
+ {
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->retryCat);
+ out << "operation retry canceled\n" << ex;
+ }
if(_outAsync->completed(ex))
{
_outAsync->invokeCompletedAsync();
@@ -86,7 +97,7 @@ IceInternal::RetryQueue::add(const ProxyOutgoingAsyncBasePtr& out, int interval)
{
throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
- RetryTaskPtr task = new RetryTask(this, out);
+ RetryTaskPtr task = new RetryTask(_instance, this, out);
out->cancelable(task); // This will throw if the request is canceled.
try
{