You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2010/06/24 19:19:58 UTC

svn commit: r957640 - in /qpid/trunk/qpid/cpp: src/qpid/cluster/Connection.cpp src/qpid/cluster/Connection.h xml/cluster.xml

Author: aconway
Date: Thu Jun 24 17:19:58 2010
New Revision: 957640

URL: http://svn.apache.org/viewvc?rev=957640&view=rev
Log:
Fix regression in r956882, sporadic failures of client_test.cpp:testBadClientData

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
    qpid/trunk/qpid/cpp/xml/cluster.xml

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp?rev=957640&r1=957639&r2=957640&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp Thu Jun 24 17:19:58 2010
@@ -262,7 +262,7 @@ void Connection::closed() {
             // until self-delivery of deliver-close.
             output.closeOutput();
             cluster.getMulticast().mcastControl(
-                ClusterConnectionDeliverCloseBody(ProtocolVersion(), false), self);
+                ClusterConnectionDeliverCloseBody(), self);
         }
     }
     catch (const std::exception& e) {
@@ -271,31 +271,26 @@ void Connection::closed() {
 }
 
 // Self-delivery of close message, close the connection.
-void Connection::deliverClose (bool aborted) {
-    QPID_LOG(debug, cluster << " replicated close of " << *this);
-    if (connection.get()) {
-        if (aborted) connection->abort();
-        else connection->closed();
-        connection.reset();
-    }
+void Connection::deliverClose () {
+    close();
     cluster.erase(self);
 }
 
 // Close the connection 
 void Connection::close() {
-    QPID_LOG(debug, cluster << " local close of " << *this);
     if (connection.get()) {
+        QPID_LOG(debug, cluster << " closed connection " << *this);
         connection->closed();
         connection.reset();
     }
 }
 
-// The connection has been killed for misbehaving, called in connection thread.
+// The connection has sent invalid data and should be aborted.
+// All members will get the same abort since they all process the same data.
 void Connection::abort() {
-    if (connection.get()) {
-        cluster.getMulticast().mcastControl(
-            ClusterConnectionDeliverCloseBody(ProtocolVersion(), true), self);
-    }
+    connection->abort();
+    // Aborting the connection will result in a call to ::closed()
+    // and allow the connection to close in an orderly manner.
 }
 
 // ConnectionCodec::decode receives read buffers from  directly-connected clients.

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h?rev=957640&r1=957639&r2=957640&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h Thu Jun 24 17:19:58 2010
@@ -170,7 +170,7 @@ class Connection :
                   const std::string& initFrames);
     void close();
     void abort();
-    void deliverClose(bool);
+    void deliverClose();
 
     OutputInterceptor& getOutput() { return output; }
 

Modified: qpid/trunk/qpid/cpp/xml/cluster.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/xml/cluster.xml?rev=957640&r1=957639&r2=957640&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/xml/cluster.xml (original)
+++ qpid/trunk/qpid/cpp/xml/cluster.xml Thu Jun 24 17:19:58 2010
@@ -134,9 +134,7 @@
     </control>
 
     <!-- Marks the cluster-wide point when a connection is considered closed. -->
-    <control name="deliver-close" code="0x2">
-      <field name="aborted" type="bit"/>
-    </control>
+    <control name="deliver-close" code="0x2"/>
 
     <!-- Permission to generate output up to the limit. -->
     <control name="deliver-do-output" code="0x3">



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org