Skip to content

Commit

Permalink
Merge pull request #41078 from makortel/fixTransformerLostException_130x
Browse files Browse the repository at this point in the history
[13_0_X] Fix propagation of an earlier exception in Transformer
  • Loading branch information
cmsbuild authored Mar 17, 2023
2 parents 60c4fd0 + 3f397f0 commit da250fc
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions FWCore/Framework/src/ProductResolvers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,17 @@ namespace edm {
return Resolution(nullptr);
}

void TransformingProductResolver::putProduct(std::unique_ptr<WrapperBase> edp) const {
// Override putProduct() to not set the resolver status to
// ResolveFailed when the Event::commit_() checks which produced
// products were actually produced and which not, because the
// transforming products are never produced by time of commit_()
// by construction.
if (edp) {
ProducedProductResolver::putProduct(std::move(edp));
}
}

void TransformingProductResolver::prefetchAsync_(WaitingTaskHolder waitTask,
Principal const& principal,
bool skipCurrentProcess,
Expand Down
3 changes: 2 additions & 1 deletion FWCore/Framework/src/ProductResolvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,12 @@ namespace edm {
class TransformingProductResolver : public ProducedProductResolver {
public:
explicit TransformingProductResolver(std::shared_ptr<BranchDescription const> bd)
: ProducedProductResolver(bd, ProductStatus::ResolveFailed), mcc_(nullptr) {}
: ProducedProductResolver(bd, ProductStatus::ResolveNotRun), mcc_(nullptr) {}

void setupUnscheduled(UnscheduledConfigurator const&) final;

private:
void putProduct(std::unique_ptr<WrapperBase> edp) const override;
Resolution resolveProduct_(Principal const& principal,
bool skipCurrentProcess,
SharedResourcesAcquirer* sra,
Expand Down
7 changes: 7 additions & 0 deletions FWCore/Integration/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@
<test name="testFWCoreIntegrationTransform_noPut" command="! cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py -- --noPut"/>
<test name="testFWCoreIntegrationTransform_noPut_async" command="! cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py -- --noPut --async_"/>

<test name="testFWCoreIntegrationTransform_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py -- --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>
<test name="testFWCoreIntegrationTransform_async_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py -- --async --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>
<test name="testFWCoreIntegrationTransform_onPath_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py -- --onPath --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>
<test name="testFWCoreIntegrationTransform_onPath_async_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py -- --onPath --async --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>




<test name="TestFWCoreIntegrationModuleThread" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/moduleThread_test_cfg.py"/>

Expand Down
3 changes: 3 additions & 0 deletions FWCore/Integration/test/transformTest_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
parser.add_argument("--noPut", help="do not put data used by transform", action="store_true")
parser.add_argument("--addTracer", help="add Tracer service", action="store_true")
parser.add_argument("--async_", help="use asynchronous module", action="store_true")
parser.add_argument("--exception", help="Make module consumed by transformer to throw an exception", action="store_true")

argv = sys.argv[:]
if '--' in argv:
Expand All @@ -27,6 +28,8 @@
process.maxEvents.input = 4

process.start = cms.EDProducer("IntProducer", ivalue = cms.int32(1))
if args.exception:
process.start = cms.EDProducer("FailingProducer")
if args.stream:
if args.async_:
process.t = cms.EDProducer("TransformAsyncIntStreamProducer", get = cms.InputTag("start"), offset = cms.uint32(1), checkTransformNotCalled = cms.untracked.bool(False))
Expand Down

0 comments on commit da250fc

Please sign in to comment.