maytasm commented on code in PR #18045:
URL: https://github.com/apache/druid/pull/18045#discussion_r2113308510


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:
##########
@@ -730,12 +735,12 @@ public Map<String, Long> getIdleTaskSlotCount()
   @Override
   public Map<String, Long> getUsedTaskSlotCount()
   {
-    return ImmutableMap.of(workerConfig.getCategory(), 
Long.valueOf(portFinder.findUsedPortCount()));
+    return ImmutableMap.of(workerConfig.getCategory(), 
getUsedTaskSlotCountLong());
   }
 
   public long getUsedTaskSlotCountLong()
   {
-    return portFinder.findUsedPortCount();
+    return Math.max(usedTaskSlotCount.get(), 0);

Review Comment:
   Why do we need a max here?



##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:
##########
@@ -768,7 +773,7 @@ public Long getWorkerIdleTaskSlotCount()
   @Override
   public Long getWorkerUsedTaskSlotCount()
   {
-    return (long) portFinder.findUsedPortCount();
+    return Math.max(usedTaskSlotCount.get(), 0);

Review Comment:
   Why do we need a max here?



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