kaijchen commented on code in PR #527:
URL: https://github.com/apache/incubator-uniffle/pull/527#discussion_r1091839317


##########
storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriteHandler.java:
##########
@@ -52,17 +52,11 @@ public LocalFileWriteHandler(
 
   private void createBasePath() {
     File baseFolder = new File(basePath);
-    // check if shuffle folder exist
-    if (!baseFolder.exists()) {
-      try {
-        // try to create folder, it may be created by other Shuffle Server
-        baseFolder.mkdirs();
-      } catch (Exception e) {
-        // if folder exist, ignore the exception
-        if (!baseFolder.exists()) {
-          LOG.error("Can't create shuffle folder:" + basePath, e);
-          throw e;
-        }
+    // try to create folder, it may already exist
+    if (!baseFolder.mkdirs()) {

Review Comment:
   The old logic does not match with the comments.
   
   `File#mkdir()` and `File#exists()` both throws `SecurityException`, which is 
a `RuntimeException`.
   However, the permission required is different, maybe we should check 
`File#exists()` first as it only requires read permission.
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to