southernriver commented on a change in pull request #2649:
URL: https://github.com/apache/iceberg/pull/2649#discussion_r641463827



##########
File path: 
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java
##########
@@ -65,6 +65,8 @@ private synchronized void init() {
               .removalListener((key, value, cause) -> ((HiveClientPool) 
value).close())
               .build();
     }
+    // cleanup cache before jvm exit, avoid some clients may not be closed.
+    Runtime.getRuntime().addShutdownHook(new 
Thread(CachedClientPool::cleanupCache));

Review comment:
       We should close the HiveClientPool  first~
   
   ```
   CachedClientPool.clientPoolCache().getIfPresent(metastoreUri);
   CachedClientPool.clientPoolCache().invalidateAll();
   ```
   




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

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