From c378600baff67d332c78cf6605de861edc5143cf Mon Sep 17 00:00:00 2001 From: Srivats P Date: Mon, 3 Apr 2023 12:47:30 +0530 Subject: [PATCH] Fix streamTiming garbage collection infinite loop --- server/streamtiming.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/streamtiming.cpp b/server/streamtiming.cpp index fc329e9..894c279 100644 --- a/server/streamtiming.cpp +++ b/server/streamtiming.cpp @@ -37,7 +37,7 @@ StreamTiming::StreamTiming() gcTimer_ = new QTimer(this); connect(gcTimer_, &QTimer::timeout, this, &StreamTiming::deleteStaleRecords); gcTimer_->setInterval(30000); - //FIXME:gcTimer_->start(); + gcTimer_->start(); } bool StreamTiming::recordTxTime(uint portId, uint guid, uint ttagId, @@ -192,11 +192,15 @@ int StreamTiming::deleteStaleRecords() struct timespec txTime = i.value().timeStamp; struct timespec diff; timespecsub(&now, &txTime, &diff); + qDebug("XXXX gc diff %ld", diff.tv_sec); if (diff.tv_sec > 30) { i = txHash_.erase(i); count++; qDebug("XXXX -%d", count); + } else { + i++; } + } // FIXME: when to stop gc timer?