Skip to content

Commit

Permalink
shmmonitor: handle missing segmentInfos
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx authored and dennisklein committed Jul 1, 2021
1 parent ac3293f commit c5e40fd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fairmq/shmem/Monitor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,14 @@ std::vector<std::pair<std::string, bool>> Monitor::Cleanup(const ShmId& shmId, b

Uint16SegmentInfoHashMap* segmentInfos = managementSegment.find<Uint16SegmentInfoHashMap>(bipc::unique_instance).first;

for (const auto& s : *segmentInfos) {
result.emplace_back(RunRemoval(Monitor::RemoveObject, "fmq_" + shmId.shmId + "_m_" + to_string(s.first), verbose));
if (segmentInfos) {
for (const auto& s : *segmentInfos) {
result.emplace_back(RunRemoval(Monitor::RemoveObject, "fmq_" + shmId.shmId + "_m_" + to_string(s.first), verbose));
}
} else {
if (verbose) {
LOG(info) << "Cannot find information about managed segments";
}
}

result.emplace_back(RunRemoval(Monitor::RemoveObject, managementSegmentName.c_str(), verbose));
Expand Down

0 comments on commit c5e40fd

Please sign in to comment.