diff options
author | Benoit Foucher <benoit@zeroc.com> | 2020-02-20 19:22:03 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2020-02-20 19:22:03 +0100 |
commit | 7e164511561d3c4fa0de8b1dcb24fc4a25b858a4 (patch) | |
tree | fb60bbddb1138113b611648939a730a7871c19e3 /java | |
parent | Removed unused SSLEngine.decodeASN1Length method, fixes #686 (diff) | |
download | ice-7e164511561d3c4fa0de8b1dcb24fc4a25b858a4.tar.bz2 ice-7e164511561d3c4fa0de8b1dcb24fc4a25b858a4.tar.xz ice-7e164511561d3c4fa0de8b1dcb24fc4a25b858a4.zip |
Don't retry invocations on fixed proxies, fixes #671
Diffstat (limited to 'java')
-rw-r--r-- | java/src/Ice/src/main/java/com/zeroc/IceInternal/ProxyFactory.java | 9 | ||||
-rw-r--r-- | java/test/src/main/java/test/Ice/retry/AllTests.java | 21 |
2 files changed, 30 insertions, 0 deletions
diff --git a/java/src/Ice/src/main/java/com/zeroc/IceInternal/ProxyFactory.java b/java/src/Ice/src/main/java/com/zeroc/IceInternal/ProxyFactory.java index 6a89d6f7f41..9ebf96b2875 100644 --- a/java/src/Ice/src/main/java/com/zeroc/IceInternal/ProxyFactory.java +++ b/java/src/Ice/src/main/java/com/zeroc/IceInternal/ProxyFactory.java @@ -90,6 +90,15 @@ public final class ProxyFactory throw ex; } + // + // If it's a fixed proxy, retrying isn't useful as the proxy is tied to + // the connection and the request will fail with the exception. + // + if (ref instanceof FixedReference) + { + throw ex; + } + if(ex instanceof com.zeroc.Ice.ObjectNotExistException) { com.zeroc.Ice.ObjectNotExistException one = (com.zeroc.Ice.ObjectNotExistException)ex; diff --git a/java/test/src/main/java/test/Ice/retry/AllTests.java b/java/test/src/main/java/test/Ice/retry/AllTests.java index d69ffd1700e..29be55bc01f 100644 --- a/java/test/src/main/java/test/Ice/retry/AllTests.java +++ b/java/test/src/main/java/test/Ice/retry/AllTests.java @@ -161,6 +161,27 @@ public class AllTests instrumentation.testRetryCount(4); out.println("ok"); + if(retry1.ice_getCachedConnection() != null) + { + out.print("testing non-idempotent operation with bi-dir proxy... "); + try + { + ((RetryPrx)retry1.ice_fixed(retry1.ice_getCachedConnection())).opIdempotent(4); + } + catch(com.zeroc.Ice.Exception ex) + { + } + instrumentation.testInvocationCount(1); + instrumentation.testFailureCount(1); + instrumentation.testRetryCount(0); + test(retry1.opIdempotent(4) == 4); + instrumentation.testInvocationCount(1); + instrumentation.testFailureCount(0); + // It suceeded after 3 retry because of the failed opIdempotent on the fixed proxy above + instrumentation.testRetryCount(3); + out.println("ok"); + } + out.print("testing non-idempotent operation... "); try { |