You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "kaijchen (via GitHub)" <gi...@apache.org> on 2023/02/16 15:52:00 UTC

[GitHub] [incubator-uniffle] kaijchen commented on a diff in pull request #616: [#571][FOLLOWUP] don't recreate base dir if it's already an dir

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


##########
storage/src/main/java/org/apache/uniffle/storage/common/LocalStorage.java:
##########
@@ -81,9 +81,16 @@ private LocalStorage(Builder builder) {
       if (isEmptyAndWritableDir(baseFolder)) {
         LOG.warn("Base directory is already an empty dir, skip init");
       } else {
-        FileUtils.deleteDirectory(baseFolder);
-        if (!baseFolder.mkdirs()) {
-          throw new IOException("Failed to create base folder: " + basePath);
+        // base folder could be the mounted path, which could not be deleted.
+        // just clean the directory instead.
+        if (baseFolder.isDirectory()) {
+          LOG.warn("Base directory is already existed, just clean");

Review Comment:
   Is it necessary to use `warn` here? I think `info` should be enough.



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org