From ece6f89c205d4b2c3c3f6d05b6c53cea068e0265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Tich=C3=A1k?= Date: Thu, 26 Sep 2024 16:04:56 +0200 Subject: [PATCH] ignore warnings variable in objectManager.cxx --- Framework/include/QualityControl/ObjectsManager.h | 4 ++-- Framework/src/ObjectsManager.cxx | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Framework/include/QualityControl/ObjectsManager.h b/Framework/include/QualityControl/ObjectsManager.h index f5173cb165..f7c10d6f1e 100644 --- a/Framework/include/QualityControl/ObjectsManager.h +++ b/Framework/include/QualityControl/ObjectsManager.h @@ -93,7 +93,7 @@ class ObjectsManager "you are trying to startPublishing object that is not mergeable." " If you know what you are doing use startPublishing(...)"); #endif - startPublishingImpl(obj, policy); + startPublishingImpl(obj, policy, IgnoreMergeable); } /** @@ -240,7 +240,7 @@ class ObjectsManager Activity mActivity; std::vector mMovingWindowsList; - void startPublishingImpl(TObject* obj, PublicationPolicy); + void startPublishingImpl(TObject* obj, PublicationPolicy, bool ignoreMergeableWarning); }; } // namespace o2::quality_control::core diff --git a/Framework/src/ObjectsManager.cxx b/Framework/src/ObjectsManager.cxx index 6e0a5f6961..0345dac7c1 100644 --- a/Framework/src/ObjectsManager.cxx +++ b/Framework/src/ObjectsManager.cxx @@ -60,19 +60,22 @@ ObjectsManager::~ObjectsManager() ILOG(Debug, Devel) << "ObjectsManager destructor" << ENDM; } -void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publicationPolicy) +void ObjectsManager::startPublishingImpl(TObject* object, PublicationPolicy publicationPolicy, bool ignoreMergeableWarning) { if (!object) { ILOG(Warning, Support) << "A nullptr provided to ObjectManager::startPublishing" << ENDM; return; } + if (mMonitorObjects->FindObject(object->GetName()) != nullptr) { ILOG(Warning, Support) << "Object is already being published (" << object->GetName() << "), will remove it and add the new one" << ENDM; stopPublishing(object->GetName()); } - if (mergers::isMergeable(object)) { - ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it might cause issues during publishing"; + + if (!ignoreMergeableWarning && !mergers::isMergeable(object)) { + ILOG(Warning, Support) << "Object '" + std::string(object->GetName()) + "' with type '" + std::string(object->ClassName()) + "' is not one of the mergeable types, it will not be correctly merged in distributed setups, such as P2 and Grid" << ENDM; } + auto* newObject = new MonitorObject(object, mTaskName, mTaskClass, mDetectorName); newObject->setIsOwner(false); newObject->setActivity(mActivity);