[
https://issues.apache.org/jira/browse/NIFI-5200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477687#comment-16477687
]
ASF subversion and git services commented on NIFI-5200:
-------------------------------------------------------
Commit 0688363d87ecdcc68a9dd18888c64a06063c3a15 in nifi's branch
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=0688363 ]
NIFI-5200: Fixed bug that caused the wrong InputStream to be closed by
StandardProcessSession if calling Session.read() from the callback of another
Session.read(); also changed default of the 'allowSessionStreamManagement' flag
from 'false' to 'true' as it will provide performance benefits in some cases
and NIFI-516 outlined that it should be 'true' initially but ended up being
false when the PR was merged.
This closes #2707
Signed-off-by: Mike Thomsen <[email protected]>
> Nested ProcessSession.read resulting in outer stream being closed.
> ------------------------------------------------------------------
>
> Key: NIFI-5200
> URL: https://issues.apache.org/jira/browse/NIFI-5200
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.6.0
> Reporter: Peter Radden
> Assignee: Mark Payne
> Priority: Minor
> Fix For: 1.7.0
>
>
> Consider this example processor:
> {code:java}
> FlowFile ff1 = session.write(session.create(),
> (out) -> { out.write(new byte[]{ 'A', 'B' }); });
> FlowFile ff2 = session.write(session.create(),
> (out) -> { out.write('C'); });
> session.read(ff1,
> (in1) -> {
> int a = in1.read();
> session.read(ff2, (in2) -> { int c = in2.read(); });
> int b = in1.read();
> });
> session.transfer(ff1, REL_SUCCESS);
> session.transfer(ff2, REL_SUCCESS);{code}
> The expectation is that a='A', b='B' and c='C'.
> The actual result is that the final call to in1.read() throws due to the
> underlying stream being closed by the previous session.read on ff2.
> A workaround seems to be to pass the optional parameter to session.read of
> allowSessionStreamManagement=true.
> Is this expected that nested reads used in this way will not work?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)