diff options
author | Alan Conway <aconway@apache.org> | 2011-06-15 20:15:51 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2011-06-15 20:15:51 +0000 |
commit | 4cdf746f5bb38db60821047c3393f89f15b26f1e (patch) | |
tree | 610a404288b464a2225668c128fa77a84020ea62 /cpp/src/qpid/cluster/ClusterTimer.cpp | |
parent | 8034affaba71c0d991bfe1fff5de537f73d0f404 (diff) | |
download | qpid-python-4cdf746f5bb38db60821047c3393f89f15b26f1e.tar.gz |
QPID-3280: Performance problem with TTL messages.
When sending a large number of messages with nonzero TTLs to a
cluster, overall message throughput drops by around 20-30% compared to
messages with TTL 0.
The previous approach to TTL in the cluster is replaced with a simpler
"cluster clock". Also QueueCleaner is executed in the cluster timer,
and modified to be deterministic in a cluster.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1136170 13f79535-47bb-0310-9956-ffa450edef68
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); } } |