You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/11 23:26:38 UTC

[GitHub] aahmed-se commented on a change in pull request #3165: Check if log folder exists

aahmed-se commented on a change in pull request #3165: Check if log folder exists
URL: https://github.com/apache/pulsar/pull/3165#discussion_r240830744
 
 

 ##########
 File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/ProcessRuntime.java
 ##########
 @@ -139,15 +139,19 @@ public void start() {
 
         // Note: we create the expected log folder before the function process logger attempts to create it
         // This is because if multiple instances are launched they can encounter a race condition creation of the dir.
-        log.info("Creating function log directory {}", funcLogDir);
-        boolean success = createFolder(funcLogDir);
 
-        if (!success) {
-            log.error("Log folder could not be created : {}", funcLogDir);
-            throw new RuntimeException("Log folder creation error");
-        }
+        final File dir = new File(funcLogDir);
+        if (!dir.exists()) {
+            log.info("Creating function log directory {}", funcLogDir);
+            boolean success = createFolder(funcLogDir);
 
 Review comment:
   Don't know of any built in functionality to make that happen. Maybe a third party library.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services