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/04 02:04:01 UTC
[GitHub] jerrypeng commented on a change in pull request #3114: Add log dir
creation in ProcessRuntime
jerrypeng commented on a change in pull request #3114: Add log dir creation in ProcessRuntime
URL: https://github.com/apache/pulsar/pull/3114#discussion_r238507333
##########
File path: pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/ProcessRuntime.java
##########
@@ -131,6 +134,19 @@
@Override
public void start() {
java.lang.Runtime.getRuntime().addShutdownHook(new Thread(() -> process.destroy()));
+
+ // 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) {
Review comment:
So what if the directory is already there? Shouldn't throw exception because directory is already there
----------------------------------------------------------------
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