Author: gsim
Date: Tue Mar  1 11:14:10 2011
New Revision: 1075777

URL: http://svn.apache.org/viewvc?rev=1075777&view=rev
Log:
QPID-2630: ensure that exclusive, auto-deleted queues are freed up on early 
deletion (remove some confusion between connection and session scope for these) 

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionState.h
    qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=1075777&r1=1075776&r2=1075777&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Tue Mar  1 11:14:10 2011
@@ -331,14 +331,6 @@ void Connection::closed(){ // Physically
     try {
         while (!channels.empty())
             ptr_map_ptr(channels.begin())->handleDetach();
-        while (!exclusiveQueues.empty()) {
-            boost::shared_ptr<Queue> q(exclusiveQueues.front());
-            q->releaseExclusiveOwnership();
-            if (q->canAutoDelete()) {
-                Queue::tryAutoDelete(broker, q);
-            }
-            exclusiveQueues.erase(exclusiveQueues.begin());
-        }
     } catch(std::exception& e) {
         QPID_LOG(error, QPID_MSG("While closing connection: " << e.what()));
         assert(0);

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionState.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionState.h?rev=1075777&r1=1075776&r2=1075777&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionState.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/ConnectionState.h Tue Mar  1 11:14:10 
2011
@@ -79,7 +79,6 @@ class ConnectionState : public Connectio
     Broker& getBroker() { return broker; }
 
     Broker& broker;
-    std::vector<boost::shared_ptr<Queue> > exclusiveQueues;
 
     //contained output tasks
     sys::AggregateOutput outputTasks;

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp?rev=1075777&r1=1075776&r2=1075777&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp Tue Mar  1 11:14:10 
2011
@@ -353,12 +353,12 @@ void SessionAdapter::QueueHandlerImpl::c
     } else if(ifUnused && queue->getConsumerCount() > 0) {
         throw PreconditionFailedException(QPID_MSG("Cannot delete queue "
                                                    << queue->getName() << "; 
queue in use"));
-    } else if (queue->isExclusiveOwner(&getConnection())) {
+    } else if (queue->isExclusiveOwner(&session)) {
         //remove the queue from the list of exclusive queues if necessary
-        QueueVector::iterator i = 
std::find(getConnection().exclusiveQueues.begin(),
-                                            
getConnection().exclusiveQueues.end(),
+        QueueVector::iterator i = std::find(exclusiveQueues.begin(),
+                                            exclusiveQueues.end(),
                                             queue);
-        if (i < getConnection().exclusiveQueues.end()) 
getConnection().exclusiveQueues.erase(i);
+        if (i < exclusiveQueues.end()) exclusiveQueues.erase(i);
     }    
 }
         



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to