diff options
Diffstat (limited to 'cpp/src/qpid/cluster/ClusterTimer.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/ClusterTimer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/ClusterTimer.cpp b/cpp/src/qpid/cluster/ClusterTimer.cpp index f6e1c7a849..b4f7d00f38 100644 --- a/cpp/src/qpid/cluster/ClusterTimer.cpp +++ b/cpp/src/qpid/cluster/ClusterTimer.cpp @@ -70,6 +70,7 @@ void ClusterTimer::add(intrusive_ptr<TimerTask> task) if (i != map.end()) throw Exception(QPID_MSG("Task already exists with name " << task->getName())); map[task->getName()] = task; + // Only the elder actually activates the task with the Timer base class. if (cluster.isElder()) { QPID_LOG(trace, "Elder activating cluster timer task " << task->getName()); @@ -112,6 +113,9 @@ void ClusterTimer::deliverWakeup(const std::string& name) { else { intrusive_ptr<TimerTask> t = i->second; map.erase(i); + // Move the nextFireTime so readyToFire() is true. This is to ensure we + // don't get an error if the fired task calls setupNextFire() + t->setFired(); Timer::fire(t); } } |