Skip to content

Commit

Permalink
Fix EPN stderr monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr committed Apr 14, 2022
1 parent 9cccd10 commit f87c784
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Utilities/EPNMonitoring/src/EPNstderrMonitor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down

0 comments on commit f87c784

Please sign in to comment.