You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/03/07 02:03:55 UTC

[GitHub] [dolphinscheduler] zhuangchong commented on a change in pull request #8707: [Fix][Master] Fix master-server execution logic thread unsafe problem

zhuangchong commented on a change in pull request #8707:
URL: https://github.com/apache/dolphinscheduler/pull/8707#discussion_r820332248



##########
File path: dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
##########
@@ -120,7 +121,7 @@ public void run() {
      * batch dispatch with thread pool
      */
     private List<TaskPriority> batchDispatch(int fetchTaskNum) throws TaskPriorityQueueException, InterruptedException {
-        List<TaskPriority> failedDispatchTasks = new ArrayList<>();
+        List<TaskPriority> failedDispatchTasks = Collections.synchronizedList(new ArrayList<>());

Review comment:
       In this method, the thread pool consumerThreadPoolExecutor operates on the variable failedDispatchTasks collection.
   
   ![image](https://user-images.githubusercontent.com/37063904/156955399-edf2a5ae-e7c5-43bc-b1a2-7717a89d0753.png)
   




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org