art-framework-suite / art

The implementation of the art physics event processing framework
Other
2 stars 7 forks source link

`ProductNotFound` exception ignored when other trigger paths are present #133

Closed PetrilloAtWork closed 1 year ago

PetrilloAtWork commented 1 year ago

I observe that in the following configuration, with ProductNotFoundThrower a producer that throws an exception and DummyProducer any producer doing anything:

physics: {
  selection: [ thrower1 ]
  prod:      [ dummy1 ]
}

physics.producers.dummy1.module_type: DummyProducer
physics.filters.thrower1.module_type: ProductNotFoundThrower
physics.filters.thrower2.module_type: ProductNotFoundThrower

the exception thrown by thrower1 filter is ignored as long as prod succeeds:

This happens even when using --rethrow-all on the command line. At least in this case I would expect that the exception would interrupt the program. Adding either thrower1 or thrower2 to the second path (reco), or removing the path reco altogether sees the exception thrown and the program immediately terminates.

A version of DummyProducer is in icaruscode v09_72_01, while the source of ProductNotFoundThrower is provided here for (moderate) convenience:

#include "art/Framework/Core/SharedFilter.h"
#include "art/Framework/Core/ModuleMacros.h"

struct ProductNotFoundThrower: public art::SharedFilter {

  explicit ProductNotFoundThrower
    (fhicl::ParameterSet const& pset, art::ProcessingFrame const&)
    : art::SharedFilter{ pset }
    { async<art::InEvent>(); }

  bool filter(art::Event&, art::ProcessingFrame const&) override
    { throw art::Exception{ art::errors::ProductNotFound } << "Told you.\n"; }

};

DEFINE_ART_MODULE(ProductNotFoundThrower)
marcpaterno commented 1 year ago

There was a commit to art on October 19, 2021 that fixed this issue. There are also two tests in place that verify that the behavior of art is as desired.

This commit went into art v3.10.00. What version are you using in which you see this failure?

PetrilloAtWork commented 1 year ago

LArSoft uses v3.09.04. :sweat:

knoepfel commented 1 year ago

LArSoft has upgraded to art 3.12, but there are still a few hiccups with getting experiments up to 3.12. Those should be alleviated with LArSoft 09.75, which includes fixes to the pythia6 build.

PetrilloAtWork commented 1 year ago

It looks like there is not much we can do here. I know ICARUS release managers are attempting a v09_75 release. Thank you for your answer!

marcpaterno commented 1 year ago

One small correction: the test is actually in the critic package, not in art.

marcpaterno commented 1 year ago

Closing this issue since it is fixed as of art 3.10.0.