Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1181#discussion_r86528178
  
    --- Diff: 
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/PutHDFS.java
 ---
    @@ -315,21 +328,24 @@ public void process(InputStream in) throws 
IOException {
                 final long millis = 
stopWatch.getDuration(TimeUnit.MILLISECONDS);
                 tempDotCopyFile = tempCopyFile;
     
    -            boolean renamed = false;
    -            for (int i = 0; i < 10; i++) { // try to rename multiple times.
    -                if (hdfs.rename(tempCopyFile, copyFile)) {
    -                    renamed = true;
    -                    break;// rename was successful
    +            if(!conflictResponse.equals(APPEND_RESOLUTION.getValue())
    +                    || 
(conflictResponse.equals(APPEND_RESOLUTION.getValue()) && !destinationExists)) {
    +                boolean renamed = false;
    +                for (int i = 0; i < 10; i++) { // try to rename multiple 
times.
    +                    if (hdfs.rename(tempCopyFile, copyFile)) {
    +                        renamed = true;
    +                        break;// rename was successful
    +                    }
    +                    Thread.sleep(200L);// try waiting to let whatever 
might cause rename failure to resolve
    --- End diff --
    
    To be honest, no I don't. I assume that there is some kind of asynchronous 
call we are doing before when talking to remote clusters and that we might need 
to make this try multiple times to actually succeed. Not sure if it is still 
required with the last versions of HDFS client but didn't want to change it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to