qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1671415 - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
Date Sun, 05 Apr 2015 18:45:51 GMT
Author: kwall
Date: Sun Apr  5 18:45:50 2015
New Revision: 1671415

URL: http://svn.apache.org/r1671415
Log:
QPID-6477: [Java Broker] Make 0-10 implementation ignore all received frames except ConnectionCloseOk
once ConnectionClose is sent

Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java?rev=1671415&r1=1671414&r2=1671415&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
Sun Apr  5 18:45:50 2015
@@ -264,16 +264,10 @@ public class AmqpPortImpl extends Abstra
     @Override
     protected ListenableFuture<Void> beforeClose()
     {
-        LOGGER.debug("beforeClose ");
-
         _closing.set(true);
 
-        //
-
         if (_connectionCount.get() == 0)
         {
-            LOGGER.debug("beforeClose - no connections remain");
-
             _noConnectionsRemain.set(null);
         }
 
@@ -520,8 +514,6 @@ public class AmqpPortImpl extends Abstra
     public int decrementConnectionCount()
     {
         int openConnections = _connectionCount.decrementAndGet();
-        LOGGER.debug("decrementConnectionCount {}", openConnections);
-
         int maxOpenConnections = getMaxOpenConnections();
 
         if(maxOpenConnections > 0
@@ -532,8 +524,6 @@ public class AmqpPortImpl extends Abstra
 
         if (_closing.get() && _connectionCount.get() == 0)
         {
-            LOGGER.debug("decrementConnectionCount - No connections remain");
-
             _noConnectionsRemain.set(null);
         }
 

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=1671415&r1=1671414&r2=1671415&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
Sun Apr  5 18:45:50 2015
@@ -58,7 +58,9 @@ import org.apache.qpid.server.util.Actio
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.transport.Connection;
+import org.apache.qpid.transport.ConnectionClose;
 import org.apache.qpid.transport.ConnectionCloseCode;
+import org.apache.qpid.transport.ConnectionCloseOk;
 import org.apache.qpid.transport.ExecutionErrorCode;
 import org.apache.qpid.transport.ExecutionException;
 import org.apache.qpid.transport.Method;
@@ -98,6 +100,7 @@ public class ServerConnection extends Co
 
     private ServerProtocolEngine _serverProtocolEngine;
     private boolean _ignoreFutureInput;
+    private boolean _ignoreAllButConnectionCloseOk;
 
     public ServerConnection(final long connectionId,
                             Broker<?> broker,
@@ -135,6 +138,10 @@ public class ServerConnection extends Co
     protected void invoke(Method method)
     {
         super.invoke(method);
+        if (method instanceof ConnectionClose)
+        {
+            _ignoreAllButConnectionCloseOk = true;
+        }
     }
 
     EventLogger getEventLogger()
@@ -330,16 +337,18 @@ public class ServerConnection extends Co
             }
         }
 
-        Subject.doAs(subject, new PrivilegedAction<Void>()
+        if(!_ignoreAllButConnectionCloseOk || (event instanceof ConnectionCloseOk))
         {
-            @Override
-            public Void run()
+            Subject.doAs(subject, new PrivilegedAction<Void>()
             {
-                ServerConnection.super.received(event);
-                return null;
-            }
-        });
-
+                @Override
+                public Void run()
+                {
+                    ServerConnection.super.received(event);
+                    return null;
+                }
+            });
+        }
     }
 
     public String toLogString()



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


Mime
View raw message