nifi-commits mailing list archives

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


ASF subversion and git services commented on NIFI-396:

Commit 3f3623647367421cd8eb318668144aca1afb9bf4 in incubator-nifi's branch refs/heads/develop
from [~rowolabi]
[;h=3f36236 ]

NIFI-396 reverting accidentially modified whitespace in TestStandardProcessSession

> StandardProcessSession allows InputStream to be accessed after returning from callback
> --------------------------------------------------------------------------------------
>                 Key: NIFI-396
>                 URL:
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>              Labels: beginner
> When, 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);
>, 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

View raw message