Public Member Functions | Private Attributes | List of all members
art::Path::WorkerDoneTask Class Reference

Public Member Functions

 WorkerDoneTask (Path *path, size_t const idx, size_t const max_idx, EventPrincipal &ep, WaitingTaskPtr pathsDone, GlobalTaskGroup &group)
 
void operator() (exception_ptr ex)
 

Private Attributes

Pathpath_
 
size_t const idx_
 
size_t const max_idx_
 
EventPrincipalep_
 
WaitingTaskPtr pathsDone_
 
GlobalTaskGroupgroup_
 

Detailed Description

Definition at line 246 of file Path.cc.

Constructor & Destructor Documentation

art::Path::WorkerDoneTask::WorkerDoneTask ( Path path,
size_t const  idx,
size_t const  max_idx,
EventPrincipal ep,
WaitingTaskPtr  pathsDone,
GlobalTaskGroup group 
)
inline

Definition at line 248 of file Path.cc.

254  : path_{path}
255  , idx_{idx}
256  , max_idx_{max_idx}
257  , ep_{ep}
258  , pathsDone_{pathsDone}
259  , group_{group}
260  {}
WaitingTaskPtr pathsDone_
Definition: Path.cc:327
size_t const idx_
Definition: Path.cc:324
EventPrincipal & ep_
Definition: Path.cc:326
GlobalTaskGroup & group_
Definition: Path.cc:328
size_t const max_idx_
Definition: Path.cc:325

Member Function Documentation

void art::Path::WorkerDoneTask::operator() ( exception_ptr  ex)
inline

Definition at line 262 of file Path.cc.

263  {
264  auto const sid = path_->pc_.scheduleID();
265  TDEBUG_BEGIN_TASK_SI(4, sid);
266  auto& workerInPath = path_->workers_[idx_];
267  // Note: This will only be set false by a filter which has rejected.
268  bool new_should_continue = workerInPath.returnCode();
269  TDEBUG_TASK_SI(4, sid) << "new_should_continue: " << new_should_continue;
270  if (ex) {
271  try {
272  rethrow_exception(ex);
273  }
274  catch (cet::exception& e) {
275  auto action = path_->actionTable_.find(e.root_cause());
276  assert(action != actions::FailModule);
277  if (action != actions::FailPath) {
278  // Possible actions: IgnoreCompletely, Rethrow, SkipEvent
279  ++path_->timesExcept_;
281  if (path_->trptr_) {
282  // Not the end path.
284  HLTPathStatus(path_->state_, idx_);
285  }
286  auto art_ex =
288  errors::ScheduleExecutionFailure, "Path: ProcessingStopped.", e}
289  << "Exception going through path " << path_->name() << "\n";
290  auto ex_ptr = make_exception_ptr(art_ex);
291  group_.may_run(pathsDone_, ex_ptr);
292  TDEBUG_END_TASK_SI(4, sid) << "terminate path because of EXCEPTION";
293  return;
294  }
295  new_should_continue = false;
296  mf::LogWarning(e.category()) << "Failing path " << path_->name()
297  << ", due to exception, message:\n"
298  << e.what() << "\n";
299  // WARNING: We continue processing below!!!
300  }
301  catch (...) {
302  mf::LogError("PassingThrough")
303  << "Exception passing through path " << path_->name() << "\n";
304  ++path_->timesExcept_;
306  if (path_->trptr_) {
307  // Not the end path.
309  HLTPathStatus(path_->state_, idx_);
310  }
311  group_.may_run(pathsDone_, current_exception());
312  TDEBUG_END_TASK_SI(4, sid) << "terminate path because of EXCEPTION";
313  return;
314  }
315  }
316 
318  idx_, max_idx_, ep_, new_should_continue, pathsDone_);
319  TDEBUG_END_TASK_SI(4, sid);
320  }
#define TDEBUG_BEGIN_TASK_SI(LEVEL, SI)
hlt::HLTState state_
Definition: Path.h:95
void process_event_workerFinished(size_t const idx, size_t const max_idx, EventPrincipal &ep, bool should_continue, hep::concurrency::WaitingTaskPtr pathsDone)
Definition: Path.cc:348
actions::ActionCodes find(std::string const &category) const
Definition: Actions.cc:71
#define TDEBUG_END_TASK_SI(LEVEL, SI)
std::string const & name() const
Definition: Path.cc:72
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
ActionTable const & actionTable_
Definition: Path.h:82
auto scheduleID() const
Definition: PathContext.h:52
#define TDEBUG_TASK_SI(LEVEL, SI)
std::size_t timesExcept_
Definition: Path.h:99
const double e
WaitingTaskPtr pathsDone_
Definition: Path.cc:327
size_t const idx_
Definition: Path.cc:324
EventPrincipal & ep_
Definition: Path.cc:326
size_t const pathPosition_
Definition: Path.h:85
cet::exempt_ptr< HLTGlobalStatus > trptr_
Definition: Path.h:90
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< WorkerInPath > workers_
Definition: Path.h:87
GlobalTaskGroup & group_
Definition: Path.cc:328
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void may_run(hep::concurrency::WaitingTaskPtr task, std::exception_ptr ex_ptr={})
PathContext const pc_
Definition: Path.h:84
size_t const max_idx_
Definition: Path.cc:325
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

EventPrincipal& art::Path::WorkerDoneTask::ep_
private

Definition at line 326 of file Path.cc.

GlobalTaskGroup& art::Path::WorkerDoneTask::group_
private

Definition at line 328 of file Path.cc.

size_t const art::Path::WorkerDoneTask::idx_
private

Definition at line 324 of file Path.cc.

size_t const art::Path::WorkerDoneTask::max_idx_
private

Definition at line 325 of file Path.cc.

Path* art::Path::WorkerDoneTask::path_
private

Definition at line 323 of file Path.cc.

WaitingTaskPtr art::Path::WorkerDoneTask::pathsDone_
private

Definition at line 327 of file Path.cc.


The documentation for this class was generated from the following file: