summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2006-04-04 18:31:22 +0000
committerMarc Laukien <marc@zeroc.com>2006-04-04 18:31:22 +0000
commit872141e1f6b150b0e752260fd3d312577d18f2fb (patch)
treee511c210a2cd7b25b74b00fa8a9e0dca4b13ed11 /cpp/src
parentadding timeout test (diff)
downloadice-872141e1f6b150b0e752260fd3d312577d18f2fb.tar.bz2
ice-872141e1f6b150b0e752260fd3d312577d18f2fb.tar.xz
ice-872141e1f6b150b0e752260fd3d312577d18f2fb.zip
attack test
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/ClientBlobject.cpp10
-rw-r--r--cpp/src/Ice/ProxyFactory.cpp51
2 files changed, 44 insertions, 17 deletions
diff --git a/cpp/src/Glacier2/ClientBlobject.cpp b/cpp/src/Glacier2/ClientBlobject.cpp
index 62d0ad63b26..c0f05ee8853 100644
--- a/cpp/src/Glacier2/ClientBlobject.cpp
+++ b/cpp/src/Glacier2/ClientBlobject.cpp
@@ -67,7 +67,17 @@ Glacier2::ClientBlobject::ice_invoke_async(const Ice::AMD_Array_Object_ice_invok
if(!proxy)
{
ObjectNotExistException ex(__FILE__, __LINE__);
+
+ //
+ // We use a special operation name indicate to the client that
+ // the proxy for the Ice object has not been found in our
+ // routing table. This can happen if the proxy was evicted
+ // from the routing table.
+ //
ex.id = current.id;
+ ex.facet = current.facet;
+ //ex.operation = current.operation;
+ ex.operation = "ice_add_proxy";
throw ex;
}
diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp
index d758934f9cd..5f9c93cc0a3 100644
--- a/cpp/src/Ice/ProxyFactory.cpp
+++ b/cpp/src/Ice/ProxyFactory.cpp
@@ -90,34 +90,54 @@ IceInternal::ProxyFactory::referenceToProxy(const ReferencePtr& ref) const
void
IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, const ReferencePtr& ref, int& cnt) const
{
- if(dynamic_cast<const ObjectNotExistException*>(&ex))
+ TraceLevelsPtr traceLevels = _instance->traceLevels();
+ LoggerPtr logger = _instance->logger();
+
+ const ObjectNotExistException* one = dynamic_cast<const ObjectNotExistException*>(&ex);
+
+ if(one)
{
- //
- // We retry ObjectNotExistException if the reference is
- // indirect. Otherwise, we don't retry other
- // *NotExistException, which are all derived from
- // RequestFailedException.
- //
LocatorInfoPtr li = ref->getLocatorInfo();
if(li)
{
+ //
+ // We retry ObjectNotExistException if the reference is
+ // indirect.
+ //
li->clearObjectCache(IndirectReferencePtr::dynamicCast(ref));
}
- else
+ else if(ref->getRouterInfo() && one->operation == "ice_add_proxy")
{
//
- // TODO: For now, we retry on ObjectNotExistException if
- // we are using a router, to handle proxies evicted by the
- // router.
+ // If we have a router, an ObjectNotExistException with an
+ // operation name "ice_add_proxy" indicates to the client
+ // that the router isn't aware of the proxy (for example,
+ // because it was evicted by the router). In this case, we
+ // must *always* retry, so that the missing proxy is added
+ // to the router.
//
- if(!ref->getRouterInfo())
+ if(traceLevels->retry >= 1)
{
- ex.ice_throw();
+ Trace out(logger, traceLevels->retryCat);
+ out << "retrying operation call to add proxy to router\n" << ex;
}
+ return; // We must always retry, so we don't look at the retry count.
+ }
+ else
+ {
+ //
+ // For all other cases, we don't retry
+ // ObjectNotExistException.
+ //
+ ex.ice_throw();
}
}
else if(dynamic_cast<const RequestFailedException*>(&ex))
{
+ //
+ // We don't retry other *NotExistException, which are all
+ // derived from RequestFailedException.
+ //
ex.ice_throw();
}
@@ -151,9 +171,6 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
++cnt;
assert(cnt > 0);
- TraceLevelsPtr traceLevels = _instance->traceLevels();
- LoggerPtr logger = _instance->logger();
-
if(cnt > static_cast<int>(_retryIntervals.size()))
{
if(traceLevels->retry >= 1)
@@ -169,7 +186,7 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
if(traceLevels->retry >= 1)
{
Trace out(logger, traceLevels->retryCat);
- out << "re-trying operation call";
+ out << "retrying operation call";
if(interval > 0)
{
out << " in " << interval << "ms";