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

    https://github.com/apache/nifi/pull/1181#discussion_r86524045
  
    --- 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 --
    
    Do you know what's this for and if we still need it? I mean not only the 
sleep, but he whole loop.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to