You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2021/06/21 16:55:55 UTC

[nifi] branch main updated: NIFI-8719: Ensure that when OutputStream is returned from StandardProcessSession.write, upon close of the OutputStream we close the underlying resources.

This is an automated email from the ASF dual-hosted git repository.

mattyb149 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new b1ad13c  NIFI-8719: Ensure that when OutputStream is returned from StandardProcessSession.write, upon close of the OutputStream we close the underlying resources.
b1ad13c is described below

commit b1ad13c83588d9206ceb8a157acb9bdb7fdbd4f8
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Mon Jun 21 10:19:27 2021 -0400

    NIFI-8719: Ensure that when OutputStream is returned from StandardProcessSession.write, upon close of the OutputStream we close the underlying resources.
    
    Signed-off-by: Matthew Burgess <ma...@apache.org>
    
    This closes #5170
---
 .../org/apache/nifi/controller/repository/StandardProcessSession.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
index e5dbc97..614abc4 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
@@ -2824,6 +2824,9 @@ public class StandardProcessSession implements ProcessSession, ProvenanceEventEn
                     }
 
                     closed = true;
+
+                    countingOut.close();
+                    rawStream.close();
                     writeRecursionSet.remove(sourceFlowFile);
 
                     final long bytesWritten = countingOut.getBytesWritten();