poorbarcode commented on code in PR #16165:
URL: https://github.com/apache/pulsar/pull/16165#discussion_r930770704


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java:
##########
@@ -104,6 +122,27 @@ public ConnectionPool(ClientConfigurationData conf, 
EventLoopGroup eventLoopGrou
 
         this.shouldCloseDnsResolver = !addressResolver.isPresent();
         this.addressResolver = addressResolver.orElseGet(() -> 
createAddressResolver(conf, eventLoopGroup));
+        // Auto release useless connections. see: 
https://github.com/apache/pulsar/issues/15516.
+        this.connectionMaxIdleSeconds = conf.getConnectionMaxIdleSeconds();
+        this.autoReleaseIdleConnectionsEnabled = connectionMaxIdleSeconds > 0;
+        if (autoReleaseIdleConnectionsEnabled) {
+            // Start async task for release useless connections.
+            this.idleDetectionIntervalSeconds = connectionMaxIdleSeconds;
+            if (this.idleDetectionIntervalSeconds < 30){

Review Comment:
   > Maybe if (this.idleDetectionIntervalSeconds < 
IDLE_DETECTION_INTERVAL_SECONDS_MIN) ?
   
   Already fixed. Thanks



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