summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ProxyFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/IceInternal/ProxyFactory.java')
-rw-r--r--java/src/IceInternal/ProxyFactory.java46
1 files changed, 35 insertions, 11 deletions
diff --git a/java/src/IceInternal/ProxyFactory.java b/java/src/IceInternal/ProxyFactory.java
index 4db252530c7..a4cfbd9bc4f 100644
--- a/java/src/IceInternal/ProxyFactory.java
+++ b/java/src/IceInternal/ProxyFactory.java
@@ -79,19 +79,46 @@ public final class ProxyFactory
public int
checkRetryAfterException(Ice.LocalException ex, Reference ref, int cnt)
{
- //
- // We retry ObjectNotExistException if the reference is
- // indirect. Otherwise, we don't retry other *NotExistException,
- // which are all derived from RequestFailedException.
- //
+ TraceLevels traceLevels = _instance.traceLevels();
+ Ice.Logger logger = _instance.initializationData().logger;
+
if(ex instanceof Ice.ObjectNotExistException)
{
+ Ice.ObjectNotExistException one = (Ice.ObjectNotExistException)ex;
+
LocatorInfo li = ref.getLocatorInfo();
- if(li == null)
+ if(li != null)
+ {
+ //
+ // We retry ObjectNotExistException if the reference is
+ // indirect.
+ //
+ li.clearObjectCache((IceInternal.IndirectReference)ref);
+ }
+ else if(ref.getRouterInfo() != null && one.operation.equals("ice_add_proxy"))
+ {
+ //
+ // 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(traceLevels.retry >= 1)
+ {
+ String s = "retrying operation call to add proxy to router\n" + ex.toString();
+ logger.trace(traceLevels.retryCat, s);
+ }
+ return cnt; // We must always retry, so we don't look at the retry count.
+ }
+ else
{
+ //
+ // For all other cases, we don't retry ObjectNotExistException.
+ //
throw ex;
}
- li.clearObjectCache((IceInternal.IndirectReference)ref);
}
else if(ex instanceof Ice.RequestFailedException)
{
@@ -128,9 +155,6 @@ public final class ProxyFactory
++cnt;
assert(cnt > 0);
- TraceLevels traceLevels = _instance.traceLevels();
- Ice.Logger logger = _instance.initializationData().logger;
-
if(cnt > _retryIntervals.length)
{
if(traceLevels.retry >= 1)
@@ -145,7 +169,7 @@ public final class ProxyFactory
if(traceLevels.retry >= 1)
{
- String s = "re-trying operation call";
+ String s = "retrying operation call";
if(interval > 0)
{
s += " in " + interval + "ms";