[ 
https://issues.apache.org/jira/browse/GOBBLIN-1619?focusedWorklogId=740282&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-740282
 ]

ASF GitHub Bot logged work on GOBBLIN-1619:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Mar/22 20:34
            Start Date: 11/Mar/22 20:34
    Worklog Time Spent: 10m 
      Work Description: homatthew commented on a change in pull request #3477:
URL: https://github.com/apache/gobblin/pull/3477#discussion_r825078113



##########
File path: 
gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java
##########
@@ -284,13 +286,7 @@ public static void 
mkdirsWithRecursivePermissionWithRetry(final FileSystem fs, f
       return;
     }
 
-    if (path.getParent() != null && !fs.exists(path.getParent())) {
-      mkdirsWithRecursivePermissionWithRetry(fs, path.getParent(), perm, 
retrierConfig);
-    }
-
-    if (!fs.mkdirs(path, perm)) {
-      throw new IOException(String.format("Unable to mkdir %s with permission 
%s", path, perm));
-    }
+    gobblinMkDirs(fs, path, perm);

Review comment:
       The change itself doesn't change any behavior. What needs to be changed 
about the javadoc if the change is completely transparent?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 740282)
    Time Spent: 0.5h  (was: 20m)

> WriterUtils.mkdirsWithRecursivePermission contains race condition and puts 
> unnecessary load on filesystem
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1619
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1619
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Matthew Ho
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The current implementation recursively calls fs.mkdirs has the following 
> issues:
>  * *Race condition for creating parent directories, causing FileNotFound 
> exception even when the file exists on file system*
>  * {*}HDFS fs.mkdirs atomically creates missing parent directories. Thus, the 
> recursive approach is making unnecessary calls.{*}{*}{*}
> HDFS, which the current FileSystem interface is built upon, guarantees the 
> parents will be created. So all FileSystem class implementations should also 
> follow this behavior. 
>  
> *Note the 
> [FileSystem|https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/FileSystem.html]
>  abstract class documentation says the following:*
> The behaviour of the filesystem is [specified in the Hadoop documentation. 
> |https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/filesystem/filesystem.html]However,
>  the normative specification of the behavior of this class is actually HDFS: 
> {color:#de350b}if HDFS does not behave the way these Javadocs or the 
> specification in the Hadoop documentations define, assume that the 
> documentation is incorrect{color}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to