You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Chaffelson (via GitHub)" <gi...@apache.org> on 2026/03/12 10:36:23 UTC

[PR] NIFI-15709 Close OutputStream when schema retrieval fails in RecordWriter [nifi]

Chaffelson opened a new pull request, #10997:
URL: https://github.com/apache/nifi/pull/10997

   ## Summary
   
   Fixes a bug in `RecordWriter` where an unclosed `OutputStream` causes `IllegalStateException` when processing JMS messages with Record Reader/Writer.
   
   ## Problem
   
   When `writerFactory.getSchema()` throws an exception (line 134), the `OutputStream` opened by `session.write(flowFile)` (line 130) is not closed before the `continue` statement. This leaves the FlowFile in an invalid state. When `recordCount == 0`, `session.remove(flowFile)` fails with:
   
   ```
   java.lang.IllegalStateException: StandardFlowFileRecord[...] already in use for an active callback or an OutputStream created by ProcessSession.write(FlowFile) has not been closed
   ```
   
   ## Fix
   
   Close `rawOut` in the catch block before continuing to the next message.
   
   ## Testing
   
   - Existing unit tests pass
   - Manual verification with ConsumeJMS + JsonTreeReader + JsonRecordSetWriter + "Use Wrapper" output strategy
   
   ## JIRA
   
   https://issues.apache.org/jira/browse/NIFI-15709


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15709 Close OutputStream when schema retrieval fails in RecordWriter [nifi]

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 merged PR #10997:
URL: https://github.com/apache/nifi/pull/10997


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org