Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Framework/src/Bookkeeping.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unistd.h>
#include <filesystem>
#include <fstream>
#include <thread>

using namespace o2::bkp::api;

Expand Down Expand Up @@ -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<int> Bookkeeping::sendFlagsForSynchronous(uint32_t runNumber, const std::string& detectorName, const std::vector<QcFlag>& qcFlags)
Expand Down
14 changes: 8 additions & 6 deletions Framework/src/TaskRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,14 @@ void TaskRunner::startCycle()

void TaskRunner::registerToBookkeeping()
{
// 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;
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;
}
Comment thread
Barthelemy marked this conversation as resolved.
Outdated
}
}

Expand Down
Loading