reswqa commented on code in PR #21125:
URL: https://github.com/apache/flink/pull/21125#discussion_r1000434409


##########
flink-rpc/flink-rpc-akka-loader/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcSystemLoader.java:
##########
@@ -55,7 +55,13 @@ public RpcSystem loadRpcSystem(Configuration config) {
             final ClassLoader flinkClassLoader = 
RpcSystem.class.getClassLoader();
 
             final Path tmpDirectory = 
Paths.get(ConfigurationUtils.parseTempDirectories(config)[0]);
-            Files.createDirectories(tmpDirectory);
+            if (!Files.isSymbolicLink(tmpDirectory)) {
+                // Create tmp dir if it doesn't exist.
+                Files.createDirectories(tmpDirectory);
+            } else if (!Files.exists(tmpDirectory)) {
+                // For symbolic link, create the linked dir if it doesn't 
exist.
+                Files.createDirectory(Files.readSymbolicLink(tmpDirectory));

Review Comment:
   To be honest, in the initial implementation, I did not cover the situation 
where symbolic links point to non-existent file. Note that the previous 
change(FLINK-23500) here is to create the temp directory if it does not exist. 
I follow the same specification for symbolic links, otherwise we will have two 
different behaviors. Although it may not be very common, symbolic links to 
non-existent files do exist.



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

Reply via email to