abhishekrb19 commented on code in PR #16719:
URL: https://github.com/apache/druid/pull/16719#discussion_r1693340319


##########
server/src/main/java/org/apache/druid/server/coordinator/duty/KillUnusedSegments.java:
##########
@@ -204,7 +230,10 @@ private void killUnusedSegments(
         );
         ++submittedTasks;
         datasourceToLastKillIntervalEnd.put(dataSource, 
intervalToKill.getEnd());
-        remainingDatasourcesToKill.remove(dataSource);
+
+        if (remainingDatasourcesToKill.isEmpty() || submittedTasks >= 
availableKillTaskSlots) {
+          break;
+        }

Review Comment:
   Yeah, we can. However, it will slightly change the semantics of the 
round-robin iteration, i.e., the loop will terminate _after_ seeing a new 
element without doing anything with it.
   
   I've added brief line comments next to these conditions for now.



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