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/02/26 17:47:23 UTC
svn commit: r916751 - in /qpid/trunk/qpid/cpp/src/qpid: cluster/Cluster.cpp
cluster/ClusterTimer.h cluster/Cpg.cpp sys/AggregateOutput.cpp
Author: aconway
Date: Fri Feb 26 16:47:23 2010
New Revision: 916751
URL: http://svn.apache.org/viewvc?rev=916751&view=rev
Log:
Fix cluster abort on shutdown in ClusterTimer::fire.
The cluster destructor was not deleting the ClusterTimer set on the
broker, so this timer had a dangling pointer to the cluster.
Modified:
qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterTimer.h
qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=916751&r1=916750&r2=916751&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Fri Feb 26 16:47:23 2010
@@ -285,6 +285,7 @@
}
Cluster::~Cluster() {
+ broker.setClusterTimer(std::auto_ptr<sys::Timer>(0)); // Delete cluster timer
if (updateThread.id()) updateThread.join(); // Join the previous updatethread.
}
@@ -1002,7 +1003,6 @@
}
void Cluster::timerWakeup(const MemberId& , const std::string& name, Lock&) {
- QPID_LOG(debug, "Cluster timer wakeup " << map.getFrameSeq() << ": " << name)
timer->deliverWakeup(name);
}
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterTimer.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterTimer.h?rev=916751&r1=916750&r2=916751&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterTimer.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterTimer.h Fri Feb 26 16:47:23 2010
@@ -30,6 +30,12 @@
class Cluster;
+/**
+ * Timer implementation that executes tasks consistently in the
+ * deliver thread across a cluster. Task is not executed when timer
+ * fires, instead the elder multicasts a wakeup. The task is executed
+ * when the wakeup is delivered.
+ */
class ClusterTimer : public sys::Timer {
public:
ClusterTimer(Cluster&);
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp?rev=916751&r1=916750&r2=916751&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cpg.cpp Fri Feb 26 16:47:23 2010
@@ -54,7 +54,6 @@
unsigned int snooze = 10;
for ( unsigned int nth_try = 0; nth_try < cpgRetries; ++ nth_try ) {
if ( CPG_OK == (result = c.op(handle, & group))) {
- QPID_LOG(info, c.opName << " successful.");
break;
}
else if ( result == CPG_ERR_TRY_AGAIN ) {
Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp?rev=916751&r1=916750&r2=916751&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp Fri Feb 26 16:47:23 2010
@@ -34,6 +34,7 @@
void AggregateOutput::giveReadCredit(int32_t credit) { control.giveReadCredit(credit); }
+namespace {
// Clear the busy flag and notify waiting threads in destructor.
struct ScopedBusy {
bool& flag;
@@ -41,7 +42,8 @@
ScopedBusy(bool& f, Monitor& m) : flag(f), monitor(m) { f = true; }
~ScopedBusy() { flag = false; monitor.notifyAll(); }
};
-
+}
+
bool AggregateOutput::doOutput() {
Mutex::ScopedLock l(lock);
ScopedBusy sb(busy, lock);
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org