summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-07-10 15:32:48 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-07-10 15:32:48 +0200
commitc8d567340f25511927032c9c17f63d3c15f90a4d (patch)
treea76b2434375b99b9ca0bf68e41e02757dcd79ae2 /java
parentFix VC++ version used with Python 2.7.x builds (diff)
downloadice-c8d567340f25511927032c9c17f63d3c15f90a4d.tar.bz2
ice-c8d567340f25511927032c9c17f63d3c15f90a4d.tar.xz
ice-c8d567340f25511927032c9c17f63d3c15f90a4d.zip
Fixed ICE-8244 - Ice/background test failure
Diffstat (limited to 'java')
-rw-r--r--java/src/Ice/src/main/java/com/zeroc/IceInternal/ConnectRequestHandler.java27
-rw-r--r--java/test/src/main/java/test/Ice/background/AllTests.java9
2 files changed, 25 insertions, 11 deletions
diff --git a/java/src/Ice/src/main/java/com/zeroc/IceInternal/ConnectRequestHandler.java b/java/src/Ice/src/main/java/com/zeroc/IceInternal/ConnectRequestHandler.java
index bf98fe557e2..6e06368678f 100644
--- a/java/src/Ice/src/main/java/com/zeroc/IceInternal/ConnectRequestHandler.java
+++ b/java/src/Ice/src/main/java/com/zeroc/IceInternal/ConnectRequestHandler.java
@@ -116,7 +116,7 @@ public class ConnectRequestHandler
{
synchronized(this)
{
- assert(_exception == null && _connection == null);
+ assert(!_flushing && _exception == null && _connection == null);
_connection = connection;
_compress = compress;
}
@@ -143,18 +143,15 @@ public class ConnectRequestHandler
{
synchronized(this)
{
- assert(!_initialized && _exception == null);
+ assert(!_flushing && !_initialized && _exception == null);
_exception = ex;
- _proxies.clear();
- _proxy = null; // Break cyclic reference count.
- notifyAll();
+ _flushing = true; // Ensures request handler is removed before processing new requests.
}
//
- // NOTE: remove the request handler *before* notifying the
- // requests that the connection failed. It's important to ensure
- // that future invocations will obtain a new connect request
- // handler once invocations are notified.
+ // NOTE: remove the request handler *before* notifying the requests that the connection
+ // failed. It's important to ensure that future invocations will obtain a new connect
+ // request handler once invocations are notified.
//
try
{
@@ -173,7 +170,15 @@ public class ConnectRequestHandler
}
}
_requests.clear();
- }
+
+ synchronized(this)
+ {
+ _flushing = false;
+ _proxies.clear();
+ _proxy = null; // Break cyclic reference count.
+ notifyAll();
+ }
+ }
//
// Implementation of RouterInfo.AddProxyCallback
@@ -225,7 +230,7 @@ public class ConnectRequestHandler
// only true for a short period of time.
//
boolean interrupted = false;
- while(_flushing && _exception == null)
+ while(_flushing)
{
try
{
diff --git a/java/test/src/main/java/test/Ice/background/AllTests.java b/java/test/src/main/java/test/Ice/background/AllTests.java
index e3f6c3774ce..b7bee1f68e9 100644
--- a/java/test/src/main/java/test/Ice/background/AllTests.java
+++ b/java/test/src/main/java/test/Ice/background/AllTests.java
@@ -585,6 +585,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -611,6 +612,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -652,6 +654,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -691,6 +694,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
background.ice_getConnection().close(com.zeroc.Ice.ConnectionClose.GracefullyWithWait);
@@ -967,6 +971,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -979,6 +984,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -1191,6 +1197,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -1203,6 +1210,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}
@@ -1245,6 +1253,7 @@ public class AllTests
}
catch(com.zeroc.Ice.LocalException ex)
{
+ ex.printStackTrace();
test(false);
}