From f87c7843b23994456f25d0ccff4dc5c01ccf4bf4 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Thu, 14 Apr 2022 21:06:18 +0200 Subject: [PATCH] Fix EPN stderr monitor --- Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx b/Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx index 14702a3595da6..d5a058db4b34d 100644 --- a/Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx +++ b/Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx @@ -42,6 +42,7 @@ struct fileMon { std::string name; unsigned int nLines = 0; unsigned int nBytes = 0; + bool stopped = false; fileMon(const std::string& path, const std::string& filename); }; @@ -166,6 +167,9 @@ void EPNMonitor::thread() std::string line; for (auto fit = mFiles.begin(); fit != mFiles.end(); fit++) { auto& f = fit->second; + if (f.stopped) { + continue; + } auto& file = f.file; file.clear(); do { @@ -187,7 +191,7 @@ void EPNMonitor::thread() nBytes += line.size(); if (f.nLines >= MAX_LINES_FILE || f.nBytes >= MAX_BYTES_FILE) { sendLog(f.name, "Exceeded log size for process " + f.name + " (" + std::to_string(f.nLines) + " lines, " + std::to_string(f.nBytes) + " bytes), not reporting any more errors from this file..."); - fit = mFiles.erase(fit); + f.stopped = true; break; } if (nLines >= MAX_LINES_TOTAL || nBytes >= MAX_BYTES_TOTAL) {