jtuglu-netflix commented on code in PR #18045:
URL: https://github.com/apache/druid/pull/18045#discussion_r2113316126


##########
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:
   This is just for safety. There are [other 
checks](https://github.com/apache/druid/blob/-/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java#L770)
 like it in the file as well. It might be even better to place the count within 
`TaskStorageDirTracker`, considering that method is already synchronized. I 
just thought it'd be cleaner to have all the task count metrics in a single 
place.



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