Skip to content

Commit

Permalink
Lock more methods of JobReport
Browse files Browse the repository at this point in the history
Production jobs were seeing scrambled job reports caused by
pileup file entries.
  • Loading branch information
Dr15Jones committed May 19, 2022
1 parent 01bfb2c commit 2347b3d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions FWCore/MessageLogger/src/JobReport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,11 @@ namespace edm {
void JobReport::inputFileClosed(InputType inputType, JobReport::Token fileToken) {
JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
f.fileHasBeenClosed = true;
std::lock_guard<std::mutex> lock(write_mutex);
if (inputType == InputType::Primary) {
impl_->writeInputFile(f);
} else {
{
std::lock_guard<std::mutex> lock(write_mutex);
impl_->writeInputFile(f);
}
impl_->writeInputFile(f);
}
}

Expand Down Expand Up @@ -433,6 +431,7 @@ namespace edm {
void JobReport::outputFileClosed(JobReport::Token fileToken) {
JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
f.fileHasBeenClosed = true;
std::lock_guard<std::mutex> lock(write_mutex);
impl_->writeOutputFile(f);
}

Expand Down Expand Up @@ -540,6 +539,7 @@ namespace edm {

void JobReport::reportMemoryInfo(std::vector<std::string> const& memoryData) {
if (impl_->ost_) {
std::lock_guard<std::mutex> lock(write_mutex);
std::ostream& msg = *(impl_->ost_);
msg << "<MemoryService>\n";

Expand All @@ -554,6 +554,7 @@ namespace edm {

void JobReport::reportMessageInfo(std::map<std::string, double> const& messageData) {
if (impl_->ost_) {
std::lock_guard<std::mutex> lock(write_mutex);
std::ostream& msg = *(impl_->ost_);
msg << "<MessageSummary>\n";
typedef std::map<std::string, double>::const_iterator const_iterator;
Expand All @@ -571,6 +572,7 @@ namespace edm {
return;
impl_->printedReadBranches_ = true;
if (impl_->ost_) {
std::lock_guard<std::mutex> lock(write_mutex);
std::ostream& ost = *(impl_->ost_);
ost << "<ReadBranches>\n";
tinyxml2::XMLDocument doc;
Expand Down

0 comments on commit 2347b3d

Please sign in to comment.