Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13_0_X] Fix propagation of an earlier exception in Transformer #41078

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
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