Damans227 commented on code in PR #13552:
URL: https://github.com/apache/cloudstack/pull/13552#discussion_r3714241292


##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -423,11 +430,28 @@ public void onManagementServerCancelMaintenance() {
     }
 
     private void initConnectExecutor() {
-        _connectExecutor = new ThreadPoolExecutor(100, 500, 60L, 
TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new 
NamedThreadFactory("AgentConnectTaskPool"));
+        Pair<Integer, Integer> poolSizeValues = 
retrieveAgentConnectPoolCoreSizeAndMaxSize();
+        _connectExecutor = new ThreadPoolExecutor(poolSizeValues.first(), 
poolSizeValues.second(), 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), 
new NamedThreadFactory("AgentConnectTaskPool"));
         // allow core threads to time out even when there are no items in the 
queue
         _connectExecutor.allowCoreThreadTimeOut(true);

Review Comment:
   Same issue as before, just with 0 instead of max<core: `agentConnectMaxSize 
< 0` lets 0 through, but `ThreadPoolExecutor` needs max strictly positive. So 
core=0, max=0 still passes validation and crashes at startup. Should this be 
`<= 0`?



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