nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pvill...@apache.org
Subject nifi git commit: NIFI-3553: If IOException is thrown when completing FTP transfer, do not update the FlowFile to point to the content that was streamed but instead leave FlowFile pointing to original version
Date Sun, 05 Mar 2017 14:28:06 GMT
Repository: nifi
Updated Branches:
  refs/heads/master 33a702500 -> 7f5c0dfb5


NIFI-3553: If IOException is thrown when completing FTP transfer, do not update the FlowFile
to point to the content that was streamed but instead leave FlowFile pointing to original
version

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #1562.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/7f5c0dfb
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/7f5c0dfb
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/7f5c0dfb

Branch: refs/heads/master
Commit: 7f5c0dfb54309cd4383799139992898f4e8e76a1
Parents: 33a7025
Author: Mark Payne <markap14@hotmail.com>
Authored: Fri Mar 3 13:18:41 2017 -0500
Committer: Pierre Villard <pierre.villard.fr@gmail.com>
Committed: Sun Mar 5 15:27:48 2017 +0100

----------------------------------------------------------------------
 .../org/apache/nifi/processors/standard/FetchFileTransfer.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/7f5c0dfb/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFileTransfer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFileTransfer.java
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFileTransfer.java
index a7ae5ef..6182b0a 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFileTransfer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFileTransfer.java
@@ -239,9 +239,9 @@ public abstract class FetchFileTransfer extends AbstractProcessor {
                 @Override
                 public void process(final OutputStream out) throws IOException {
                     StreamUtils.copy(in, out);
+                    transfer.flush();
                 }
             });
-            transfer.flush();
             transferQueue.offer(new FileTransferIdleWrapper(transfer, System.nanoTime()));
         } catch (final FileNotFoundException e) {
             getLogger().error("Failed to fetch content for {} from filename {} on remote
host {} because the file could not be found on the remote system; routing to {}",
@@ -255,14 +255,14 @@ public abstract class FetchFileTransfer extends AbstractProcessor {
             session.transfer(session.penalize(flowFile), REL_PERMISSION_DENIED);
             session.getProvenanceReporter().route(flowFile, REL_PERMISSION_DENIED);
             return;
-        } catch (final IOException e) {
+        } catch (final ProcessException | IOException e) {
             try {
                 transfer.close();
             } catch (final IOException e1) {
                 getLogger().warn("Failed to close connection to {}:{} due to {}", new Object[]
{host, port, e.toString()}, e);
             }
 
-            getLogger().error("Failed to fetch content for {} from filename {} on remote
host {}:{} due to {}; routing to failure",
+            getLogger().error("Failed to fetch content for {} from filename {} on remote
host {}:{} due to {}; routing to comms.failure",
                 new Object[] {flowFile, filename, host, port, e.toString()}, e);
             session.transfer(session.penalize(flowFile), REL_COMMS_FAILURE);
             return;


Mime
View raw message