summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-09-19 15:50:16 +0200
committerBenoit Foucher <benoit@zeroc.com>2016-09-19 15:50:16 +0200
commit6a76c0cb8bbd4d310e7ffe98d175a1e5af4e3d59 (patch)
tree3fbd0f8e529f3de4f4b19dbdaee203cbdd8e0f10 /java/src
parentFixed ICE-7317 - timeout test failure (diff)
downloadice-6a76c0cb8bbd4d310e7ffe98d175a1e5af4e3d59.tar.bz2
ice-6a76c0cb8bbd4d310e7ffe98d175a1e5af4e3d59.tar.xz
ice-6a76c0cb8bbd4d310e7ffe98d175a1e5af4e3d59.zip
Fixed ICE-6363 (Java & C#) - hang when trying to contact the locator
Diffstat (limited to 'java/src')
-rw-r--r--java/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java53
1 files changed, 31 insertions, 22 deletions
diff --git a/java/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java b/java/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java
index b2fb41d7ced..dd0e3bd4c78 100644
--- a/java/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java
+++ b/java/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java
@@ -35,30 +35,38 @@ class PluginI implements Ice.Plugin
void
invoke(Ice.LocatorPrx l)
{
- _locatorPrx = l;
- try
+ if(_locatorPrx == null || !_locatorPrx.equals(l))
{
- l.begin_ice_invoke(_operation, _mode, _inParams, _context,
- new Ice.Callback_Object_ice_invoke()
- {
- @Override
- public void
- response(boolean ok, byte[] outParams)
- {
- _amdCB.ice_response(ok, outParams);
- }
-
- @Override
- public void
- exception(Ice.LocalException ex)
+ _locatorPrx = l;
+ try
+ {
+ l.begin_ice_invoke(_operation, _mode, _inParams, _context,
+ new Ice.Callback_Object_ice_invoke()
{
- Request.this.exception(ex);
- }
- });
+ @Override
+ public void
+ response(boolean ok, byte[] outParams)
+ {
+ _amdCB.ice_response(ok, outParams);
+ }
+
+ @Override
+ public void
+ exception(Ice.LocalException ex)
+ {
+ Request.this.exception(ex);
+ }
+ });
+ }
+ catch(Ice.LocalException ex)
+ {
+ exception(ex);
+ }
}
- catch(Ice.LocalException ex)
+ else
{
- exception(ex);
+ assert(_exception != null); // Don't retry if the proxy didn't change
+ _amdCB.ice_exception(_exception);
}
}
@@ -91,6 +99,7 @@ class PluginI implements Ice.Plugin
}
catch(Ice.LocalException exc)
{
+ _exception = exc;
_locator.invoke(_locatorPrx, Request.this); // Retry with new locator proxy
}
}
@@ -102,7 +111,8 @@ class PluginI implements Ice.Plugin
private final byte[] _inParams;
private final Ice.AMD_Object_ice_invoke _amdCB;
- private Ice.LocatorPrx _locatorPrx;
+ private Ice.LocatorPrx _locatorPrx = null;
+ private Ice.LocalException _exception = null;
};
static private class VoidLocatorI extends Ice._LocatorDisp
@@ -246,7 +256,6 @@ class PluginI implements Ice.Plugin
_pendingRequests.clear();
}
-
public synchronized void
invoke(Ice.LocatorPrx locator, Request request)
{