[
https://issues.apache.org/jira/browse/NIFI-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015069#comment-16015069
]
ASF GitHub Bot commented on NIFI-3894:
--------------------------------------
GitHub user ijokarumawak opened a pull request:
https://github.com/apache/nifi/pull/1820
NIFI-3894: Fixed close and consume order with compression.
Before this fix, 'NullPointerException: Inflater has been closed' can be
thrown as the Inflater is closed before input stream is consumed.
Also, calling close from AbstractTransaction.receive is removed, because
the DataPacket is exposed as its return value and this class will not be able
to know when to close the stream.
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [x] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number
you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [x] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [x] Have you ensured that the full suite of tests is executed via mvn
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file, including the main
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to
.name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in
which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ijokarumawak/nifi nifi-3894-2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/1820.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1820
----
commit eca019811f5f51f2b81915f79887c1e594832027
Author: Koji Kawamura <[email protected]>
Date: 2017-05-18T01:05:08Z
NIFI-3894: Fixed close and consume order with compression.
Before this fix, 'NullPointerException: Inflater has been closed' can be
thrown as the Inflater is closed before input stream is consumed.
Also, calling close from AbstractTransaction.receive is removed, because
the DataPacket is exposed as its return value and this class will not be able
to know when to close the stream.
----
> NiFi Crashes with OOM if compression is enabled on an RPG with high number of
> FlowFiles
> ---------------------------------------------------------------------------------------
>
> Key: NIFI-3894
> URL: https://issues.apache.org/jira/browse/NIFI-3894
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 0.7.0
> Reporter: Koji Kawamura
> Assignee: Koji Kawamura
> Fix For: 1.3.0
>
>
> RemoteProcessGroup can be configured to use compression per port.
> OutOfMemoryError occurred with a large amount of FlowFiles queued in an
> output port and a NiFi S2S client pulled those via RPG with compression
> enabled. Without compression, the same amount of FlowFiles can be transferred
> without issue. Here is the stack trace:
> {code}
> 2017-04-06 18:21:59,063 WARN [Timer-Driven Process Thread-5]
> o.a.n.c.t.ContinuallyRunConnectableTask
> StandardRootGroupPort[id=cc3ad50e-0159-1000-0000-00001c8cf0ef]
> Administratively Pausing for 10 seconds due to processing failure:
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError: null
> at java.util.zip.Deflater.init(Native Method) ~[na:1.8.0_77]
> at java.util.zip.Deflater.<init>(Deflater.java:171) ~[na:1.8.0_77]
> at java.util.zip.Deflater.<init>(Deflater.java:180) ~[na:1.8.0_77]
> at
> org.apache.nifi.remote.io.CompressionOutputStream.<init>(CompressionOutputStream.java:54)
> ~[nifi-utils-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
> {code}
> It happens because CompressionOutputStream.close does not call end() method
> of a Deflater It calls resets() but not end().
> https://github.com/apache/nifi/blob/master/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/remote/io/CompressionOutputStream.java#L141
> The issue is the same with this:
> JDK-4797189 : Finalizers not called promptly enough
> http://bugs.java.com/view_bug.do?bug_id=4797189
> {quote}
> WORK AROUND
> Invoke "end()" on any Inflator or Deflator once it is no longer in use. This
> will clean up the process space (non Java/GC) memory.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)