Skip to content

Commit

Permalink
Fixed bug in TPStreamWriter tardy TP logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Biery committed Jul 5, 2024
1 parent 32aecd6 commit 475f215
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/TPStreamWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ TPStreamWriter::do_work(std::atomic<bool>& 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;
Expand All @@ -254,14 +257,11 @@ TPStreamWriter::do_work(std::atomic<bool>& 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,
Expand Down

0 comments on commit 475f215

Please sign in to comment.