smallx commented on a change in pull request #3606:
URL: https://github.com/apache/iceberg/pull/3606#discussion_r762570545



##########
File path: 
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -106,6 +107,38 @@
       GC_ENABLED, "external.table.purge"
   );
 
+  private static Map<Long, String> tableLocksById;
+  private static ClientPool<IMetaStoreClient, TException> globalMetaClients;
+
+  /**
+   * Initialize a hook to avoid that the finally code block used to unlock 
hive table may not be executed
+   * due to the following conditions:
+   *   - System.exit(N)
+   *   - all non-daemon threads exit
+   *
+   * Also, to avoid memory leaks caused by addShutdownHook, we use a class 
level hook.
+   */
+  private static synchronized void initUnlockTableHook(ClientPool metaClients) 
{
+    globalMetaClients = metaClients;

Review comment:
       Thanks. I've fixed it.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to