You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by tk...@apache.org on 2015/10/27 02:58:20 UTC
[2/3] nifi git commit: NIFI-1073 fixed possible, but not realistic,
resource leak in DistributedMapCacheClientService
NIFI-1073 fixed possible, but not realistic, resource leak in DistributedMapCacheClientService
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a5501ac7
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a5501ac7
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a5501ac7
Branch: refs/heads/NIFI-1073
Commit: a5501ac77af9e75faf7037072bb84c4ae59e2875
Parents: aef73fd
Author: Tony Kurc <tr...@gmail.com>
Authored: Mon Oct 26 21:35:45 2015 -0400
Committer: Tony Kurc <tr...@gmail.com>
Committed: Mon Oct 26 21:35:45 2015 -0400
----------------------------------------------------------------------
.../nifi/controller/repository/VolatileContentRepository.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/a5501ac7/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
index 7c7cade..0451812 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/VolatileContentRepository.java
@@ -50,6 +50,7 @@ import org.apache.nifi.processor.DataUnit;
import org.apache.nifi.stream.io.ByteArrayInputStream;
import org.apache.nifi.stream.io.StreamUtils;
import org.apache.nifi.util.NiFiProperties;
+import org.apache.nifi.util.file.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -407,8 +408,12 @@ public class VolatileContentRepository implements ContentRepository {
@Override
public long exportTo(ContentClaim claim, OutputStream destination, long offset, long length) throws IOException {
final InputStream in = read(claim);
+ try {
StreamUtils.skip(in, offset);
StreamUtils.copy(in, destination, length);
+ } finally {
+ FileUtils.closeQuietly(in);
+ }
return length;
}