WangJPLeo commented on code in PR #9955:
URL: https://github.com/apache/dolphinscheduler/pull/9955#discussion_r912601455


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java:
##########
@@ -129,11 +149,13 @@ public void run() {
                 if (CollectionUtils.isNotEmpty(failedDispatchTasks)) {
                     
TaskMetrics.incTaskDispatchFailed(failedDispatchTasks.size());
                     for (TaskPriority dispatchFailedTask : 
failedDispatchTasks) {
-                        taskPriorityQueue.put(dispatchFailedTask);
-                    }
-                    // If the all task dispatch failed, will sleep for 1s to 
avoid the master cpu higher.
-                    if (fetchTaskNum == failedDispatchTasks.size()) {
-                        
TimeUnit.MILLISECONDS.sleep(Constants.SLEEP_TIME_MILLIS);
+                        // service alarm when retries 100 times
+                        if (dispatchFailedTask.getDispatchFailedRetryTimes() 
== Constants.DEFAULT_MAX_RETRY_COUNT){
+                            logger.error("the number of retries for dispatch 
failure has exceeded the maximum limit, taskId: {} processInstanceId: {}", 
dispatchFailedTask.getTaskId(), dispatchFailedTask.getProcessInstanceId());
+                            // business alarm
+                        }
+                        // differentiate the queue to prevent high priority 
from affecting the execution of other tasks
+                        
taskPriorityDispatchFailedQueue.put(dispatchFailedTask);

Review Comment:
   Instead of stopping the retry, the retry interval is increased according to 
the number of retries. When the maximum number of retries is reached, each time 
interval is 100s. This is described in the comment on line 222 (retry more than 
100 times with 100 seconds delay each time).



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

Reply via email to