Skip to content

Commit

Permalink
Fix propagation of earlier exception in Transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Feb 24, 2023
1 parent 80b0d70 commit 3f397f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
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
5 changes: 0 additions & 5 deletions FWCore/Integration/test/transformTest_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
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")
parser.add_argument("--outputFile", help="File to save job output", default=None, type=str)

argv = sys.argv[:]
if '--' in argv:
Expand All @@ -23,10 +22,6 @@


process = cms.Process("TEST")
if args.outputFile is not None:
process.MessageLogger.cerr.enable = False
process.MessageLogger.files.outputFile = dict(filename=args.outputFile,
noTimeStamps= True)

process.source = cms.Source("EmptySource")

Expand Down

0 comments on commit 3f397f0

Please sign in to comment.