qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1667346 - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/transport/ broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ common/src/main/java/org/apache/qpid/transport/ systests...
Date Tue, 17 Mar 2015 16:11:19 GMT
Author: rgodfrey
Date: Tue Mar 17 16:11:18 2015
New Revision: 1667346

URL: http://svn.apache.org/r1667346
Log:
QPID-6429 : Fix issue when async close is called twice on a session, tidy up debug and logging

Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/InternalBrokerHolder.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java?rev=1667346&r1=1667345&r2=1667346&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
Tue Mar 17 16:11:18 2015
@@ -83,12 +83,10 @@ class NetworkConnectionScheduler
                     {
                         if (_running.get() == _poolSize)
                         {
-                            LOGGER.debug("RGDEBUG: scheduler rescheduling");
                             schedule(connection);
                         }
                         else
                         {
-                            LOGGER.debug("RGDEBUG: scheduler rerunning - ( " + _running.get()
+ "/" + _poolSize + ")");
                             rerun = true;
                         }
                     }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java?rev=1667346&r1=1667345&r2=1667346&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java
Tue Mar 17 16:11:18 2015
@@ -50,7 +50,7 @@ public class NonBlockingNetworkTransport
     private static final int TIMEOUT = Integer.getInteger(CommonProperties.IO_NETWORK_TRANSPORT_TIMEOUT_PROP_NAME,
                                                           CommonProperties.IO_NETWORK_TRANSPORT_TIMEOUT_DEFAULT);
     private static final int HANDSHAKE_TIMEOUT = Integer.getInteger(CommonProperties.HANDSHAKE_TIMEOUT_PROP_NAME
,
-                                                                   CommonProperties.HANDSHAKE_TIMEOUT_DEFAULT);
+                                                                    CommonProperties.HANDSHAKE_TIMEOUT_DEFAULT);
     private final Set<TransportEncryption> _encryptionSet;
     private final NetworkTransportConfiguration _config;
     private final ProtocolEngineFactory _factory;

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java?rev=1667346&r1=1667345&r2=1667346&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
Tue Mar 17 16:11:18 2015
@@ -175,8 +175,6 @@ public class SelectorThread extends Thre
                 toBeScheduled.add(connection);
                 try
                 {
-                    LOGGER.debug("KWDEBUG# Setting interest to zero (PUC) " + connection);
-
                     SelectionKey register = connection.getSocketChannel().register(_selector,
0);
                     register.cancel();
                 }
@@ -210,7 +208,6 @@ public class SelectorThread extends Thre
                             | (unregisteredConnection.waitingForWrite() ? SelectionKey.OP_WRITE
: 0);
             try
             {
-                LOGGER.debug("KWDEBUG# Registering " + unregisteredConnection);
                 unregisteredConnection.getSocketChannel().register(_selector, ops, unregisteredConnection);
             }
             catch (ClosedChannelException e)
@@ -240,8 +237,6 @@ public class SelectorThread extends Thre
 
                 try
                 {
-                    LOGGER.debug("KWDEBUG# Setting interest to zero (PSK)" + connection);
-
                     key.channel().register(_selector, 0);
                 }
                 catch (ClosedChannelException e)

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java?rev=1667346&r1=1667345&r2=1667346&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
Tue Mar 17 16:11:18 2015
@@ -260,21 +260,24 @@ public class ServerConnection extends Co
             @Override
             public void performAction(final ServerConnection conn)
             {
-                ExecutionException ex = new ExecutionException();
-                ExecutionErrorCode code = ExecutionErrorCode.INTERNAL_ERROR;
-                try
+                if(!session.isClosing())
                 {
-                    code = ExecutionErrorCode.get(cause.getCode());
-                }
-                catch (IllegalArgumentException iae)
-                {
-                    // Ignore, already set to INTERNAL_ERROR
-                }
-                ex.setErrorCode(code);
-                ex.setDescription(message);
-                session.invoke(ex);
+                    ExecutionException ex = new ExecutionException();
+                    ExecutionErrorCode code = ExecutionErrorCode.INTERNAL_ERROR;
+                    try
+                    {
+                        code = ExecutionErrorCode.get(cause.getCode());
+                    }
+                    catch (IllegalArgumentException iae)
+                    {
+                        // Ignore, already set to INTERNAL_ERROR
+                    }
+                    ex.setErrorCode(code);
+                    ex.setDescription(message);
+                    session.invoke(ex);
 
-                session.close(cause, message);
+                    session.close(cause, message);
+                }
             }
         });
 
@@ -382,20 +385,23 @@ public class ServerConnection extends Co
             @Override
             public void performAction(final ServerConnection object)
             {
-                closeSubscriptions();
-                performDeleteTasks();
-
-                setState(CLOSING);
-                ConnectionCloseCode replyCode = ConnectionCloseCode.NORMAL;
-                try
-                {
-                    replyCode = ConnectionCloseCode.get(cause.getCode());
-                }
-                catch (IllegalArgumentException iae)
+                if(!isClosing())
                 {
-                    // Ignore
+                    closeSubscriptions();
+                    performDeleteTasks();
+
+                    setState(CLOSING);
+                    ConnectionCloseCode replyCode = ConnectionCloseCode.NORMAL;
+                    try
+                    {
+                        replyCode = ConnectionCloseCode.get(cause.getCode());
+                    }
+                    catch (IllegalArgumentException iae)
+                    {
+                        // Ignore
+                    }
+                    sendConnectionClose(replyCode, message);
                 }
-                sendConnectionClose(replyCode, message);
             }
         });
     }

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java?rev=1667346&r1=1667345&r2=1667346&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java Tue
Mar 17 16:11:18 2015
@@ -622,11 +622,6 @@ public class Connection extends Connecti
         close(ConnectionCloseCode.NORMAL, null);
     }
 
-    public void mgmtClose()
-    {
-        close(ConnectionCloseCode.CONNECTION_FORCED, "The connection was closed using the
broker's management interface.");
-    }
-
 
     protected void sendConnectionClose(ConnectionCloseCode replyCode, String replyText, Option
... _options)
     {
@@ -875,4 +870,12 @@ public class Connection extends Connecti
         _redirecting.set(redirecting);
     }
 
+    public boolean isClosing()
+    {
+        synchronized (lock)
+        {
+            return state == CLOSING || state == CLOSED;
+        }
+    }
+
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/InternalBrokerHolder.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/InternalBrokerHolder.java?rev=1667346&r1=1667345&r2=1667346&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/InternalBrokerHolder.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/InternalBrokerHolder.java
Tue Mar 17 16:11:18 2015
@@ -49,7 +49,7 @@ public class InternalBrokerHolder implem
     @Override
     public void start(BrokerOptions options) throws Exception
     {
-        if (Thread.getDefaultUncaughtExceptionHandler() != null)
+        if (Thread.getDefaultUncaughtExceptionHandler() == null)
         {
             Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
             {



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


Mime
View raw message