kbendick commented on a change in pull request #2785:
URL: https://github.com/apache/iceberg/pull/2785#discussion_r665759590
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java
##########
@@ -65,6 +68,14 @@ private synchronized void init() {
.removalListener((key, value, cause) -> ((HiveClientPool)
value).close())
.build();
}
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run() {
+ LOG.info("Before clientPool closed, clientPool().getCurrentSize() =
{}", clientPool().getCurrentSize());
Review comment:
Nit: Would this be better as a lower log level? Additionally, would it
make more sense to format this as human readable / formatted text as opposed to
references to functions (which might be awkward for end users)?
For example: `The CachedClientPool has a size of {}`.
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java
##########
@@ -65,6 +68,14 @@ private synchronized void init() {
.removalListener((key, value, cause) -> ((HiveClientPool)
value).close())
.build();
}
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run() {
+ LOG.info("Before clientPool closed, clientPool().getCurrentSize() =
{}", clientPool().getCurrentSize());
+ clientPool().close();
Review comment:
Do we need to check if `close` has already been called and/or if the
result of calling `clientPool()` is not null?
--
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]