markap14 commented on code in PR #8943:
URL: https://github.com/apache/nifi/pull/8943#discussion_r1636512167


##########
nifi-extension-bundles/nifi-py4j-bundle/nifi-py4j-bridge/src/main/java/org/apache/nifi/python/processor/RecordTransformProxy.java:
##########
@@ -264,13 +265,16 @@ private void writeResult(final RecordTransformResult 
result, final Map<RecordGro
             final FlowFile destinationFlowFile = 
session.create(originalFlowFile);
 
             final RecordSetWriter writer;
+            OutputStream out = null;

Review Comment:
   Yeah, we don't want to close the OutputStream unless there is an Exception. 
Under normal operation, the OutputStream is provided to the RecordSetWriter, 
and that is returned and managed at a higher level. In reviewing the code, I 
just happened to notice that if an Exception were to get thrown in that block, 
we catch it, remove the FlowFIle, and re-throw it but fail to close the 
underlying OutputStream.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to