apucher commented on a change in pull request #3634: [TE] task - randomize 
execution order to increase parallel throughput
URL: https://github.com/apache/incubator-pinot/pull/3634#discussion_r244895106
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/anomaly/task/TaskDriver.java
 ##########
 @@ -147,6 +149,9 @@ private TaskDTO acquireTask() {
       if (CollectionUtils.isNotEmpty(anomalyTasks)) {
         LOG.info("Thread {} : Found {} tasks in waiting state", 
Thread.currentThread().getId(), anomalyTasks.size());
 
+        // shuffle candidate tasks to avoid synchronized patterns across 
threads (and hosts)
+        Collections.shuffle(anomalyTasks);
 
 Review comment:
   the order already isn't deterministic (multiple threads, head-tail fetching 
at random). So this doesn't change the guarantees or semantics of task execution

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to