WangJPLeo commented on code in PR #11464:
URL: https://github.com/apache/dolphinscheduler/pull/11464#discussion_r945119153
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java:
##########
@@ -176,6 +203,41 @@ public List<TaskPriority> batchDispatch(int fetchTaskNum)
throws TaskPriorityQue
return failedDispatchTasks;
}
+ /**
+ * put the failed dispatch task into the dispatch queue again
+ */
+ private void dispatchFailedBackToTaskPriorityQueue(int fetchTaskNum)
throws TaskPriorityQueueException, InterruptedException {
+ try {
+ for (int i = 0; i < fetchTaskNum; i++) {
+ TaskPriority dispatchFailedTaskPriority =
taskPriorityDispatchFailedQueue.poll(Constants.SLEEP_TIME_MILLIS,
TimeUnit.MILLISECONDS);
+ if (Objects.isNull(dispatchFailedTaskPriority)){
+ continue;
+ }
+ if (canRetry(dispatchFailedTaskPriority)){
+
dispatchFailedTaskPriority.setDispatchFailedRetryTimes(dispatchFailedTaskPriority.getDispatchFailedRetryTimes()
+ 1);
+ taskPriorityQueue.put(dispatchFailedTaskPriority);
+ } else {
+
taskPriorityDispatchFailedQueue.put(dispatchFailedTaskPriority);
Review Comment:
1. When the task is taken out of the failure queue and placed in the
dispatch queue, it will not be put into the failure queue again if the
execution is successful.
2. We guarantee that tasks can always be retried in case of failure.
--
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]