From 475f2155a651e8702f63e4c78215844c5fc19fb1 Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Fri, 5 Jul 2024 14:03:24 -0500 Subject: [PATCH] Fixed bug in TPStreamWriter tardy TP logic --- plugins/TPStreamWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/TPStreamWriter.cpp b/plugins/TPStreamWriter.cpp index 09c5e8f..0432569 100644 --- a/plugins/TPStreamWriter.cpp +++ b/plugins/TPStreamWriter.cpp @@ -246,6 +246,9 @@ TPStreamWriter::do_work(std::atomic& running_flag) usleep(retry_wait_usec); retry_wait_usec *= 2; } catch (const IgnorableDataStoreProblem& excpt) { + int timeslice_number_diff = largest_timeslice_number - timeslice_ptr->get_header().timeslice_number; + double seconds_too_late = m_accumulation_interval_seconds * timeslice_number_diff; + m_tardy_timeslice_max_seconds = std::max(m_tardy_timeslice_max_seconds.load(), seconds_too_late); if (warn_user_when_tardy_tps_are_discarded) { std::ostringstream sid_list; bool first_frag = true; @@ -254,14 +257,11 @@ TPStreamWriter::do_work(std::atomic& running_flag) else {sid_list << ",";} sid_list << frag_ptr->get_element_id().to_string(); } - int timeslice_number_diff = largest_timeslice_number - timeslice_ptr->get_header().timeslice_number; - double seconds_too_late = m_accumulation_interval_seconds * timeslice_number_diff; ers::warning(TardyTPsDiscarded(ERS_HERE, get_name(), sid_list.str(), timeslice_ptr->get_header().timeslice_number, seconds_too_late)); - m_tardy_timeslice_max_seconds = std::max(m_tardy_timeslice_max_seconds.load(), seconds_too_late); } } catch (const std::exception& excpt) { ers::warning(DataWritingProblem(ERS_HERE,