nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NIFI-396) StandardProcessSession allows InputStream to be accessed after returning from callback
Date Fri, 20 Mar 2015 13:22:39 GMT

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

ASF subversion and git services commented on NIFI-396:
------------------------------------------------------

Commit 3f3623647367421cd8eb318668144aca1afb9bf4 in incubator-nifi's branch refs/heads/develop
from [~rowolabi]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-nifi.git;h=3f36236 ]

NIFI-396 reverting accidentially modified whitespace in TestStandardProcessSession


> StandardProcessSession allows InputStream to be accessed after returning from callback
> --------------------------------------------------------------------------------------
>
>                 Key: NIFI-396
>                 URL: https://issues.apache.org/jira/browse/NIFI-396
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>              Labels: beginner
>
> When StandardProcessSession.read(FlowFile, InputStreamCallback) or StandardProcessSession.write(FlowFile,
StreamCallback) is called, the InputStream that is provided to the callback can be accessed
after returning from the callback. For example:
> final ObjectHolder<InputStream> inputStreamHolder = new ObjectHolder<>(null);
>        session.read(flowFile, new InputStreamCallback() {
>             @Override
>             public void process(InputStream in) throws IOException {
>                 inputStreamHolder.set(in);
>             }
>         });
> // read from inputStreamHolder.get()
> At this point, attempting to read from inputStreamHolder.get() should throw an IOException
but does not.
> This is because the stream that is returned by StandardProcessSession is wrapping a NonCloseableInputStream.
This NonCloseableInputStream should instead be a DisableOnCloseInputStream (which does not
exist but should be written in a very similar fashion to DisableOnCloseOutputStream).
> The JavaDocs for ProcessSession should also be updated to indicate that the streams provided
will be managed by the framework and will not be accessible once the callback returns.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message