[ 
https://issues.apache.org/jira/browse/NIFI-5150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464065#comment-16464065
 ] 

Mark Payne commented on NIFI-5150:
----------------------------------

[~peterr] thanks for pointing this out! Definitely an important bug to fix. 
Fortunately, it was fairly easy to replicate in a unit test, given the 
description in your comments. I have created a PR that includes the unit test 
that results just as you described, and also a fix for the issue.

> ProcessSession.append resulting in content from wrong FlowFile
> --------------------------------------------------------------
>
>                 Key: NIFI-5150
>                 URL: https://issues.apache.org/jira/browse/NIFI-5150
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.5.0, 1.6.0
>            Reporter: Peter Radden
>            Priority: Major
>
> Consider the following two processors with these simple implementations:
> Processor1:
> {quote}
> {code:java}
> FlowFile ffa = session.create();
> ffa = session.write(ffa, (out) -> out.write('A'));
> session.transfer(ffa, REL_SUCCESS);
> FlowFile ffb = session.create();
> ffb = session.write(ffb, (out) -> out.write('B'));
> session.transfer(ffb, REL_SUCCESS);{code}
> {quote}
> Processor2:
> {quote}
> {code:java}
> FlowFile ff = session.get();
> ff = session.append(ff, (out) -> out.write('C'));
> session.transfer(ff, REL_SUCCESS);{code}
> {quote}
> Processor2 is connected to the Success relationship of Processor1.
> After Processor1 has been triggered, the connecting queue should have two 
> FlowFiles with content "A" and "B".  This is correct, and they seem to have 
> the same Content Claim identifier with offsets 1 byte apart, and size also 1 
> byte.
> After Processor2, the expected contents are "AC" and "BC".
> In fact, both flowfiles are 3 bytes in size with contents "ABC".
> This suggests that the claim offset and size are not applied correctly when 
> using ProcessSession.append.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to