diff --git a/Framework/src/AggregatorRunner.cxx b/Framework/src/AggregatorRunner.cxx index cb66bf1ce8..ddcea3ae4f 100644 --- a/Framework/src/AggregatorRunner.cxx +++ b/Framework/src/AggregatorRunner.cxx @@ -380,11 +380,7 @@ void AggregatorRunner::start(ServiceRegistryRef services) // register ourselves to the BK if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration ILOG(Debug, Devel) << "Registering aggregator to BookKeeping" << ENDM; - try { - Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, AggregatorRunner::getDetectorName(mAggregators), bkp::DplProcessType::QC_AGGREGATOR, ""); - } catch (std::runtime_error& error) { - ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM; - } + Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, AggregatorRunner::getDetectorName(mAggregators), bkp::DplProcessType::QC_AGGREGATOR, ""); } } diff --git a/Framework/src/Bookkeeping.cxx b/Framework/src/Bookkeeping.cxx index aae2f505e1..d779ff1e57 100644 --- a/Framework/src/Bookkeeping.cxx +++ b/Framework/src/Bookkeeping.cxx @@ -22,6 +22,7 @@ #include #include #include +#include using namespace o2::bkp::api; @@ -113,7 +114,14 @@ void Bookkeeping::registerProcess(int runNumber, const std::string& name, const if (!mInitialized) { return; } - mClient->dplProcessExecution()->registerProcessExecution(runNumber, type, getHostName(), name, args, detector); + + std::thread([this, runNumber, type, name, args, detector]() { + try { + this->mClient->dplProcessExecution()->registerProcessExecution(runNumber, type, getHostName(), name, args, detector); + } catch (std::runtime_error& error) { // catch here because we are in a thread + ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM; + } + }).detach(); } std::vector Bookkeeping::sendFlagsForSynchronous(uint32_t runNumber, const std::string& detectorName, const std::vector& qcFlags) diff --git a/Framework/src/CheckRunner.cxx b/Framework/src/CheckRunner.cxx index 0f954e1546..35e34f8de6 100644 --- a/Framework/src/CheckRunner.cxx +++ b/Framework/src/CheckRunner.cxx @@ -458,11 +458,7 @@ void CheckRunner::start(ServiceRegistryRef services) // register ourselves to the BK if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration ILOG(Debug, Devel) << "Registering checkRunner to BookKeeping" << ENDM; - try { - Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, mDetectorName, bkp::DplProcessType::QC_CHECKER, ""); - } catch (std::runtime_error& error) { - ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM; - } + Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, mDetectorName, bkp::DplProcessType::QC_CHECKER, ""); } } diff --git a/Framework/src/PostProcessingRunner.cxx b/Framework/src/PostProcessingRunner.cxx index 24d596cf49..294ef12075 100644 --- a/Framework/src/PostProcessingRunner.cxx +++ b/Framework/src/PostProcessingRunner.cxx @@ -189,11 +189,7 @@ void PostProcessingRunner::start(framework::ServiceRegistryRef dplServices) // register ourselves to the BK if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration ILOG(Debug, Devel) << "Registering pp task to BookKeeping" << ENDM; - try { - Bookkeeping::getInstance().registerProcess(mActivity.mId, mRunnerConfig.taskName, mRunnerConfig.detectorName, bkp::DplProcessType::QC_POSTPROCESSING, ""); - } catch (std::runtime_error& error) { - ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM; - } + Bookkeeping::getInstance().registerProcess(mActivity.mId, mRunnerConfig.taskName, mRunnerConfig.detectorName, bkp::DplProcessType::QC_POSTPROCESSING, ""); } if (mTaskState == TaskState::Created || mTaskState == TaskState::Finished) { diff --git a/Framework/src/TaskRunner.cxx b/Framework/src/TaskRunner.cxx index 613763c8dd..372ab19962 100644 --- a/Framework/src/TaskRunner.cxx +++ b/Framework/src/TaskRunner.cxx @@ -437,11 +437,7 @@ void TaskRunner::registerToBookkeeping() if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration // register ourselves to the BK at the first cycle ILOG(Debug, Devel) << "Registering taskRunner to BookKeeping" << ENDM; - try { - Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bkp::DplProcessType::QC_TASK, ""); - } catch (std::runtime_error& error) { - ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM; - } + Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bkp::DplProcessType::QC_TASK, ""); } }