Repository: qpid-jms
Updated Branches:
  refs/heads/master 4314482de -> bbc00f58a


QPIDJMS-416 Allow the event loop to run until Transport close

Allow the event loop to close only on Transport close to ensure that
work can be done async by users of the Transport up to the close.

Also fixes some random test failures by ensuring that the init method
failure triggers channel abort before connection completes.


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/bbc00f58
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/bbc00f58
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/bbc00f58

Branch: refs/heads/master
Commit: bbc00f58a326eab0668bd2bfa91fdc97ca30297e
Parents: 4314482
Author: Timothy Bish <tabish...@gmail.com>
Authored: Thu Oct 11 19:10:35 2018 -0400
Committer: Timothy Bish <tabish...@gmail.com>
Committed: Thu Oct 11 20:38:37 2018 -0400

----------------------------------------------------------------------
 .../qpid/jms/transports/netty/NettyTcpTransport.java     | 11 +++--------
 .../qpid/jms/transports/netty/NettyTcpTransportTest.java |  2 +-
 .../qpid/jms/transports/netty/NettyWsTransportTest.java  |  2 ++
 3 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bbc00f58/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
index e9c66b7..1cf9ead 100644
--- 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
+++ 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
@@ -168,7 +168,9 @@ public class NettyTcpTransport implements Transport {
                     try {
                         initRoutine.run();
                     } catch (Throwable initError) {
-                        failureCause = IOExceptionSupport.create(initError);
+                        LOG.warn("Error during initialization of channel from 
provided initialization routine");
+                        connectionFailed(connectedChannel, 
IOExceptionSupport.create(initError));
+                        throw initError;
                     }
                 }
                 configureChannel(connectedChannel);
@@ -203,13 +205,6 @@ public class NettyTcpTransport implements Transport {
                 channel.close().syncUninterruptibly();
                 channel = null;
             }
-            if (group != null) {
-                Future<?> fut = group.shutdownGracefully(0, SHUTDOWN_TIMEOUT, 
TimeUnit.MILLISECONDS);
-                if (!fut.awaitUninterruptibly(2 * SHUTDOWN_TIMEOUT)) {
-                    LOG.trace("Channel group shutdown failed to complete in 
allotted time");
-                }
-                group = null;
-            }
 
             throw failureCause;
         } else {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bbc00f58/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyTcpTransportTest.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyTcpTransportTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyTcpTransportTest.java
index 469be6e..87cf074 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyTcpTransportTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyTcpTransportTest.java
@@ -562,7 +562,7 @@ public class NettyTcpTransportTest extends QpidJmsTestCase {
             transport.close();
         }
 
-        assertTrue(transportClosed);  // Normal shutdown does not trigger the 
event.
+        assertFalse(transportClosed);  // Normal shutdown does not trigger the 
event.
         assertTrue(exceptions.isEmpty());
         assertTrue(data.isEmpty());
     }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bbc00f58/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyWsTransportTest.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyWsTransportTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyWsTransportTest.java
index 2ea873d..4e3164c 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyWsTransportTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/transports/netty/NettyWsTransportTest.java
@@ -317,6 +317,8 @@ public class NettyWsTransportTest extends 
NettyTcpTransportTest {
                     return false;
                 }
             }, 10000, 10));
+
+            transport.close();
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to