From 926a8579152de5cb48fd3effca9bd41616650e94 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs Date: Wed, 20 Dec 2023 11:54:12 -0500 Subject: [PATCH 1/2] Changed check for no nodes in pool --- src/app/reporting/SynchronizedReportSchedulerImpl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/reporting/SynchronizedReportSchedulerImpl.cpp b/src/app/reporting/SynchronizedReportSchedulerImpl.cpp index 6627cf7116bec3..990b3cfd0eab03 100644 --- a/src/app/reporting/SynchronizedReportSchedulerImpl.cpp +++ b/src/app/reporting/SynchronizedReportSchedulerImpl.cpp @@ -182,6 +182,9 @@ void SynchronizedReportSchedulerImpl::TimerFired() Timestamp now = mTimerDelegate->GetCurrentMonotonicTimestamp(); bool firedEarly = true; + // If there are no handlers registers, no need to take actions + VerifyOrReturn(mNodesPool.Allocated()); + mNodesPool.ForEachActiveObject([now, &firedEarly](ReadHandlerNode * node) { if (node->GetMinTimestamp() <= now) { @@ -201,8 +204,7 @@ void SynchronizedReportSchedulerImpl::TimerFired() return Loop::Continue; }); - // If there are no handlers registers, no need to schedule the next report - if (mNodesPool.Allocated() && firedEarly) + if (firedEarly) { Timeout timeout = Milliseconds32(0); ReturnOnFailure(CalculateNextReportTimeout(timeout, nullptr, now)); From 3b290c6b6be3aead90fa74d7d4793d14b9ec9bfb Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:41:23 -0500 Subject: [PATCH 2/2] Update src/app/reporting/SynchronizedReportSchedulerImpl.cpp Co-authored-by: Boris Zbarsky --- src/app/reporting/SynchronizedReportSchedulerImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/reporting/SynchronizedReportSchedulerImpl.cpp b/src/app/reporting/SynchronizedReportSchedulerImpl.cpp index 990b3cfd0eab03..7dfa84c70e5343 100644 --- a/src/app/reporting/SynchronizedReportSchedulerImpl.cpp +++ b/src/app/reporting/SynchronizedReportSchedulerImpl.cpp @@ -182,7 +182,7 @@ void SynchronizedReportSchedulerImpl::TimerFired() Timestamp now = mTimerDelegate->GetCurrentMonotonicTimestamp(); bool firedEarly = true; - // If there are no handlers registers, no need to take actions + // If there are no handlers registered, no need to do anything. VerifyOrReturn(mNodesPool.Allocated()); mNodesPool.ForEachActiveObject([now, &firedEarly](ReadHandlerNode * node) {