narendly commented on a change in pull request #973:
URL: https://github.com/apache/helix/pull/973#discussion_r419686031



##########
File path: helix-core/src/main/java/org/apache/helix/model/ClusterConfig.java
##########
@@ -137,6 +140,7 @@
   private final static int MAX_REBALANCE_PREFERENCE = 10;
   private final static int MIN_REBALANCE_PREFERENCE = 0;
   public final static boolean DEFAULT_GLOBAL_REBALANCE_ASYNC_MODE_ENABLED = 
true;
+  public static final int TARGET_TASK_THREAD_POOL_SIZE_NOT_SET = -1;

Review comment:
       +1 to what @jiajunwang  said.

##########
File path: 
helix-core/src/main/java/org/apache/helix/task/TaskStateModelFactory.java
##########
@@ -102,4 +107,36 @@ public boolean isShutdown() {
   public boolean isTerminated() {
     return _taskExecutor.isTerminated();
   }
+
+  /*
+   * Get target thread pool size from InstanceConfig first; if that fails, get 
it from
+   * ClusterConfig; if that fails, fall back to the default value.
+   */
+  private static int getTaskThreadPoolSize(HelixManager manager) {
+    ConfigAccessor configAccessor = manager.getConfigAccessor();
+    // Check instance config first for thread pool size
+    InstanceConfig instanceConfig =
+        configAccessor.getInstanceConfig(manager.getClusterName(), 
manager.getInstanceName());
+    if (instanceConfig != null) {

Review comment:
       I am okay with returning the default size because creating a thread pool 
with a default size won't be the end of the world and won't affect the user too 
much. And the user can always try to set it again or restart if they want to 
change the thread pool size. 
   
   But we should make it clear to the user. I don't see any log or notification 
here, so that could be a problem.




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