summaryrefslogtreecommitdiff
path: root/http/timer_queue.hpp
diff options
context:
space:
mode:
authorKarthick Sundarrajan <karthick.sundarrajan@intel.com>2020-12-08 01:22:46 +0300
committerEd Tanous <ed@tanous.net>2020-12-12 05:04:26 +0300
commit8ba7ae5b697305b9e9829186e1017977325225ce (patch)
treed122ee9b2a37785e930832b3d7fc5bc41b7b1a44 /http/timer_queue.hpp
parenta82207087d79c4dd85447bdacfd4de91be4e7166 (diff)
downloadbmcweb-8ba7ae5b697305b9e9829186e1017977325225ce.tar.xz
Flush the timer queue at each timer cancellation
When attempting to make parallel connections, the BMC is not able to handle more than 25 connections. Found that the timerQueue gets filled with both valid and expired timers. The main timer fires every one second and flush the queue which is not enough for BMCs with high speed processors. So flushing the queue in TimerQueue::cancel() to make room for new connections when the timers are cancelled. Tested: Tested on the BMC with high speed processor and able to make parallel connections without failures. Change-Id: Ib899f5ba3f60c009aeeff462f01d4b45522b803d Signed-off-by: Karthick Sundarrajan <karthick.sundarrajan@intel.com>
Diffstat (limited to 'http/timer_queue.hpp')
-rw-r--r--http/timer_queue.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/http/timer_queue.hpp b/http/timer_queue.hpp
index 5baf7beecb..24a4ab4c12 100644
--- a/http/timer_queue.hpp
+++ b/http/timer_queue.hpp
@@ -32,6 +32,11 @@ class TimerQueue
{
dq[index].second = nullptr;
}
+ while (dq.begin() != dq.end() && dq.front().second == nullptr)
+ {
+ dq.pop_front();
+ step++;
+ }
}
std::optional<size_t> add(std::function<void()> f)