diqiu50 commented on code in PR #10742:
URL: https://github.com/apache/gravitino/pull/10742#discussion_r3083592466


##########
catalogs/hive-metastore-common/src/main/java/org/apache/gravitino/hive/kerberos/FetchFileUtils.java:
##########
@@ -19,23 +19,34 @@
 package org.apache.gravitino.hive.kerberos;
 
 import java.io.File;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
 public class FetchFileUtils {
 
+  /**
+   * Per-destination lock map used to serialize concurrent symlink creation 
for the same keytab
+   * file. Keyed by the normalized absolute destination path string to avoid 
races caused by
+   * different path spellings referring to the same file.
+   */
+  private static final ConcurrentHashMap<String, Object> SYMLINK_LOCKS = new 
ConcurrentHashMap<>();

Review Comment:
   I added a function removeLock, which is called when the Kerberos client 
closes.



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