From d65fea00d5486c0bb228082535f7bc57d2630494 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Wed, 26 Apr 2023 11:38:00 +0530 Subject: [PATCH] Change stream timing GC timer to CLOCK_REALTIME --- server/streamtiming.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/streamtiming.cpp b/server/streamtiming.cpp index f8d24e4..bc5ad5a 100644 --- a/server/streamtiming.cpp +++ b/server/streamtiming.cpp @@ -179,11 +179,13 @@ int StreamTiming::deleteStaleRecords() { // FIXME: yield after a certain count of records or time? - // FIXME: Can we compare 'now' below with libpcap provided timestamp? - // Are their sources same or synced? + // XXX: We assume the Tx packet timestamps are based on CLOCK_REALTIME + // (or a similar and comparable source). Since garbage collection timer + // is not a short interval, it need not be the exact same source as long + // as the values are comparable int count = 0; struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); + clock_gettime(CLOCK_REALTIME, &now); // XXX: processRecords() iterates and deletes all rx records irrespective // of whether it found a matching tx record. So for garbage collection we