You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/10/20 10:06:10 UTC

[GitHub] [flink] zentol commented on a diff in pull request #21125: [FLINK-28102] Flink AkkaRpcSystemLoader fails when temporary directory is a symlink

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


##########
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:
   Logic like this doesn't belong in here, but in some re-usable file util.



-- 
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@flink.apache.org

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