summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2017-02-02 12:33:17 -0800
committerMark Spruiell <mes@zeroc.com>2017-02-02 12:33:17 -0800
commitd652dd90a69826d92a13f88a173fa3dbd2e17b76 (patch)
tree768db00699525be54f1d314909a90268eefedb20
parentReorder metrics on Server and Service (diff)
downloadice-d652dd90a69826d92a13f88a173fa3dbd2e17b76.tar.bz2
ice-d652dd90a69826d92a13f88a173fa3dbd2e17b76.tar.xz
ice-d652dd90a69826d92a13f88a173fa3dbd2e17b76.zip
Connection::close fixes for C#/Java/JS
-rw-r--r--csharp/src/Ice/ProxyFactory.cs9
-rw-r--r--csharp/test/Ice/ami/AllTests.cs13
-rw-r--r--java-compat/src/Ice/src/main/java/IceInternal/ProxyFactory.java8
-rw-r--r--java/src/Ice/src/main/java/com/zeroc/IceInternal/ProxyFactory.java7
-rw-r--r--js/src/Ice/ProxyFactory.js8
5 files changed, 28 insertions, 17 deletions
diff --git a/csharp/src/Ice/ProxyFactory.cs b/csharp/src/Ice/ProxyFactory.cs
index 178d073150b..64c357a333a 100644
--- a/csharp/src/Ice/ProxyFactory.cs
+++ b/csharp/src/Ice/ProxyFactory.cs
@@ -170,12 +170,13 @@ namespace IceInternal
throw ex;
}
-
//
- // Don't retry if the communicator is destroyed or object adapter
- // deactivated.
+ // Don't retry if the communicator is destroyed, object adapter is deactivated,
+ // or connection is manually closed.
//
- if(ex is Ice.CommunicatorDestroyedException || ex is Ice.ObjectAdapterDeactivatedException)
+ if(ex is Ice.CommunicatorDestroyedException ||
+ ex is Ice.ObjectAdapterDeactivatedException ||
+ ex is Ice.ConnectionManuallyClosedException)
{
throw ex;
}
diff --git a/csharp/test/Ice/ami/AllTests.cs b/csharp/test/Ice/ami/AllTests.cs
index dd91682ff69..0a515a0b2e9 100644
--- a/csharp/test/Ice/ami/AllTests.cs
+++ b/csharp/test/Ice/ami/AllTests.cs
@@ -3439,8 +3439,10 @@ public class AllTests : TestCommon.AllTests
// This test requires two threads in the server's thread pool: one will block in sleep() and the other
// will process the CloseConnection message.
//
+ p.ice_ping();
+ Ice.Connection con = p.ice_getConnection();
Task t = p.sleepAsync(100);
- p.ice_getConnection().close(Ice.ConnectionClose.CloseGracefully);
+ con.close(Ice.ConnectionClose.CloseGracefully);
try
{
t.Wait();
@@ -3458,7 +3460,8 @@ public class AllTests : TestCommon.AllTests
// despite the fact that there's a pending call to sleep(). The call to sleep() should be
// automatically retried and complete successfully.
//
- Ice.Connection con = p.ice_getConnection();
+ p.ice_ping();
+ con = p.ice_getConnection();
CallbackBase cb = new CallbackBase();
con.setCloseCallback(_ =>
{
@@ -3480,8 +3483,10 @@ public class AllTests : TestCommon.AllTests
// Local case: start a lengthy operation and then close the connection forcefully on the client side.
// There will be no retry and we expect the invocation to fail with ConnectionManuallyClosedException.
//
- Task t = p.sleepAsync(100);
- p.ice_getConnection().close(Ice.ConnectionClose.CloseForcefully);
+ p.ice_ping();
+ Ice.Connection con = p.ice_getConnection();
+ Task t = p.sleepAsync(5000);
+ con.close(Ice.ConnectionClose.CloseForcefully);
try
{
t.Wait();
diff --git a/java-compat/src/Ice/src/main/java/IceInternal/ProxyFactory.java b/java-compat/src/Ice/src/main/java/IceInternal/ProxyFactory.java
index 43fd22d3030..88e23f4621a 100644
--- a/java-compat/src/Ice/src/main/java/IceInternal/ProxyFactory.java
+++ b/java-compat/src/Ice/src/main/java/IceInternal/ProxyFactory.java
@@ -187,10 +187,12 @@ public final class ProxyFactory
}
//
- // Don't retry if the communicator is destroyed or object adapter
- // deactivated.
+ // Don't retry if the communicator is destroyed, object adapter is deactivated,
+ // or connection is manually closed.
//
- if(ex instanceof Ice.CommunicatorDestroyedException || ex instanceof Ice.ObjectAdapterDeactivatedException)
+ if(ex instanceof Ice.CommunicatorDestroyedException ||
+ ex instanceof Ice.ObjectAdapterDeactivatedException ||
+ ex instanceof Ice.ConnectionManuallyClosedException)
{
throw ex;
}
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 5fef6998469..321ac80e0b8 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
@@ -185,11 +185,12 @@ public final class ProxyFactory
}
//
- // Don't retry if the communicator is destroyed or object adapter
- // deactivated.
+ // Don't retry if the communicator is destroyed, object adapter is deactivated,
+ // or connection is manually closed.
//
if(ex instanceof com.zeroc.Ice.CommunicatorDestroyedException ||
- ex instanceof com.zeroc.Ice.ObjectAdapterDeactivatedException)
+ ex instanceof com.zeroc.Ice.ObjectAdapterDeactivatedException ||
+ ex instanceof com.zeroc.Ice.ConnectionManuallyClosedException)
{
throw ex;
}
diff --git a/js/src/Ice/ProxyFactory.js b/js/src/Ice/ProxyFactory.js
index fee91c6061c..ea8ac6a10b0 100644
--- a/js/src/Ice/ProxyFactory.js
+++ b/js/src/Ice/ProxyFactory.js
@@ -213,10 +213,12 @@ class ProxyFactory
}
//
- // Don't retry if the communicator is destroyed or object adapter
- // deactivated.
+ // Don't retry if the communicator is destroyed, object adapter is deactivated,
+ // or connection is manually closed.
//
- if(ex instanceof Ice.CommunicatorDestroyedException || ex instanceof Ice.ObjectAdapterDeactivatedException)
+ if(ex instanceof Ice.CommunicatorDestroyedException ||
+ ex instanceof Ice.ObjectAdapterDeactivatedException ||
+ ex instanceof Ice.ConnectionManuallyClosedException)
{
throw ex;
}