diff --git a/nifi-extension-bundles/nifi-extension-utils/nifi-bin-manager/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java b/nifi-extension-bundles/nifi-extension-utils/nifi-bin-manager/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java index 97d0748037..9ccb8eb0a4 100644 --- a/nifi-extension-bundles/nifi-extension-utils/nifi-bin-manager/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java +++ b/nifi-extension-bundles/nifi-extension-utils/nifi-bin-manager/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java @@ -252,7 +252,9 @@ public abstract class BinFiles extends AbstractSessionFactoryProcessor { // If this bin's session has been committed, move on. if (!binProcessingResult.isCommitted()) { final ProcessSession binSession = bin.getSession(); - bin.getContents().forEach(ff -> binSession.putAllAttributes(ff, binProcessingResult.getAttributes())); + if (!context.isAutoTerminated(REL_ORIGINAL)) { + bin.getContents().forEach(ff -> binSession.putAllAttributes(ff, binProcessingResult.getAttributes())); + } binSession.transfer(bin.getContents(), REL_ORIGINAL); binSession.commitAsync(); } diff --git a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JoinEnrichment.java b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JoinEnrichment.java index d6fa268bca..44f504da0e 100644 --- a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JoinEnrichment.java +++ b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JoinEnrichment.java @@ -527,7 +527,9 @@ public class JoinEnrichment extends BinFiles { // If this bin's session has been committed, move on. if (!binProcessingResult.isCommitted()) { final ProcessSession binSession = bin.getSession(); - bin.getContents().forEach(ff -> binSession.putAllAttributes(ff, binProcessingResult.getAttributes())); + if (!context.isAutoTerminated(REL_ORIGINAL)) { + bin.getContents().forEach(ff -> binSession.putAllAttributes(ff, binProcessingResult.getAttributes())); + } binSession.transfer(bin.getContents(), REL_ORIGINAL); // Migrate FlowFiles to our batch session. Then commit the bin session to free up any resources