You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/03/03 02:44:11 UTC

[GitHub] [druid] kfaraz commented on a change in pull request #12298: Add config for lazy connections to mitigate overwhelming of Coordinator

kfaraz commented on a change in pull request #12298:
URL: https://github.com/apache/druid/pull/12298#discussion_r818268078



##########
File path: core/src/main/java/org/apache/druid/java/util/http/client/pool/ResourcePool.java
##########
@@ -177,7 +183,8 @@ private ImmediateCreationResourceHolder(
       this.unusedResourceTimeoutMillis = unusedResourceTimeoutMillis;
       this.resourceHolderList = new ArrayDeque<>();
 
-      for (int i = 0; i < maxSize; ++i) {
+      final int initializationSize = eagerInitialization ? maxSize : 1;
+      for (int i = 0; i < initializationSize; ++i) {

Review comment:
       If `eager` is false, it would create just one connection on start-up.
   Would it ever create more connections or will it always remain at 1?

##########
File path: core/src/main/java/org/apache/druid/java/util/http/client/HttpClientConfig.java
##########
@@ -118,6 +121,11 @@ public int getNumConnections()
     return numConnections;
   }
 
+  public boolean isEagerInitialization()
+  {
+    return eagerInitialization;

Review comment:
       Nit: I feel `lazy` is a more commonly used term for such use cases rather than `eager`. I would prefer `lazyConnections` rather than `eagerInitialization`.




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org