maswin commented on code in PR #20403:
URL: https://github.com/apache/druid/pull/20403#discussion_r4147613269


##########
processing/src/main/java/org/apache/druid/java/util/http/client/pool/ResourcePool.java:
##########
@@ -62,8 +64,17 @@ public class ResourcePool<K, V> implements Closeable
   public ResourcePool(final ResourceFactory<K, V> factory, final 
ResourcePoolConfig config,
                       final boolean eagerInitialization)
   {
-    this.pool = CacheBuilder.newBuilder().build(
-        new CacheLoader<>()
+    this.pool = CacheBuilder.newBuilder()
+                            
.expireAfterAccess(config.getUnusedConnectionTimeoutMillis(), 
TimeUnit.MILLISECONDS)
+                            .removalListener(
+                                (RemovalNotification<K, 
ResourceHolderPerKey<K, V>> notification) -> {
+                                  if (notification.wasEvicted()) {
+                                    notification.getValue().close();

Review Comment:
   Done. Removed expireAfterAccess usage, current method doesn't have this issue



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