Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EPN stderr monitor #8589

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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