Skip to content

Commit bde6e1b

Browse files
authored
Fix wrong warnings about bad flags assigned to good qualities (#2583)
Due to the order of processing in WorstOfAllAggregator, we could get cases when a bad Flag (coming from Bad quality) would be assigned to Good quality, while the quality itself would be replaced just after. This commit reverses the order, which will silence the wrong warning. The same code was also reused TrendCheck, thus I am fixing it also there.
1 parent b6a9077 commit bde6e1b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Framework/src/AggregatorRunner.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ AggregatorRunner::QualityObjectsWithAggregatorNameVector AggregatorRunner::aggre
174174
ILOG(Info, Devel) << "Processing aggregator: " << aggregatorName << ENDM;
175175

176176
if (mUpdatePolicyManager.isReady(aggregatorName)) {
177-
ILOG(Info, Devel) << " Quality Objects for the aggregator '" << aggregatorName << "' are ready, aggregating" << ENDM;
177+
ILOG(Info, Devel) << " Quality Objects for the aggregator '" << aggregatorName << "' are ready, aggregating" << ENDM;
178178
auto newQOs = aggregator->aggregate(mQualityObjects, *mActivity); // we give the whole list
179179
mTotalNumberObjectsProduced += newQOs.size();
180180
mTotalNumberAggregatorExecuted++;

Modules/Common/src/TrendCheck.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ Quality TrendCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>*
345345
Quality result = mQualities.empty() ? Quality::Null : Quality::Good;
346346
for (auto& [key, quality] : mQualities) {
347347
(void)key;
348-
for (const auto& flag : quality.getFlags()) {
349-
result.addFlag(flag.first, flag.second);
350-
}
351348
if (quality.isWorseThan(result)) {
352349
result.set(quality);
353350
}
351+
for (const auto& flag : quality.getFlags()) {
352+
result.addFlag(flag.first, flag.second);
353+
}
354354
}
355355

356356
return result;

Modules/Common/src/WorstOfAllAggregator.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ std::map<std::string, Quality> WorstOfAllAggregator::aggregate(QualityObjectsMap
4141
Quality current = Quality::Good;
4242
for (const auto& [qoName, qo] : qoMap) {
4343
(void)qoName;
44-
for (const auto& flag : qo->getFlags()) {
45-
current.addFlag(flag.first, flag.second);
46-
}
4744
if (qo->getQuality().isWorseThan(current)) {
4845
current.set(qo->getQuality());
4946
}
47+
for (const auto& flag : qo->getFlags()) {
48+
current.addFlag(flag.first, flag.second);
49+
}
5050
}
5151
ILOG(Info, Devel) << "Aggregated Quality: " << current << ENDM;
5252

0 commit comments

Comments
 (0)