diff --git a/FWCore/Framework/src/ProductResolvers.cc b/FWCore/Framework/src/ProductResolvers.cc index 80971d7f4e93a..61285158f5c9b 100644 --- a/FWCore/Framework/src/ProductResolvers.cc +++ b/FWCore/Framework/src/ProductResolvers.cc @@ -516,6 +516,17 @@ namespace edm { return Resolution(nullptr); } + void TransformingProductResolver::putProduct(std::unique_ptr 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, diff --git a/FWCore/Framework/src/ProductResolvers.h b/FWCore/Framework/src/ProductResolvers.h index 9cd119784787c..8df0278d4b8a8 100644 --- a/FWCore/Framework/src/ProductResolvers.h +++ b/FWCore/Framework/src/ProductResolvers.h @@ -257,11 +257,12 @@ namespace edm { class TransformingProductResolver : public ProducedProductResolver { public: explicit TransformingProductResolver(std::shared_ptr bd) - : ProducedProductResolver(bd, ProductStatus::ResolveFailed), mcc_(nullptr) {} + : ProducedProductResolver(bd, ProductStatus::ResolveNotRun), mcc_(nullptr) {} void setupUnscheduled(UnscheduledConfigurator const&) final; private: + void putProduct(std::unique_ptr edp) const override; Resolution resolveProduct_(Principal const& principal, bool skipCurrentProcess, SharedResourcesAcquirer* sra, diff --git a/FWCore/Integration/test/BuildFile.xml b/FWCore/Integration/test/BuildFile.xml index 3d7dc427d8f8e..dbedf4400376c 100644 --- a/FWCore/Integration/test/BuildFile.xml +++ b/FWCore/Integration/test/BuildFile.xml @@ -91,6 +91,10 @@ + + + + diff --git a/FWCore/Integration/test/transformTest_cfg.py b/FWCore/Integration/test/transformTest_cfg.py index d9554cb3fcc78..2699c4a54e7df 100644 --- a/FWCore/Integration/test/transformTest_cfg.py +++ b/FWCore/Integration/test/transformTest_cfg.py @@ -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: @@ -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))