slimtom95 opened a new issue, #16764:
URL: https://github.com/apache/dolphinscheduler/issues/16764

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   Here I quote the following piece of code in 
`GlobalTaskDispatchWaitingQueueLooper`.
   The java doc says the waiting time won't exceed 60 seconds, while using 
Math.max clearly does the opposite.
   
   ```
               // If dispatch failed, will put the task back to the queue
               // The task will be dispatched after waiting time.
               // the waiting time will increase multiple of times, but will 
not exceed 60 seconds
               long waitingTimeMills = Math.max(
                       
taskExecutionRunnable.getTaskExecutionContext().increaseDispatchFailTimes() * 
1_000L, 60_000L);
               
globalTaskDispatchWaitingQueue.dispatchTaskExecuteRunnableWithDelay(taskExecutionRunnable,
                       waitingTimeMills);
               log.error("Dispatch Task: {} failed will retry after: {}/ms", 
taskInstance.getName(), waitingTimeMills, e);
   ```
   
   ### What you expected to happen
   
   Replace `Math.max` with `Math.min`
   
   
   
   ### How to reproduce
   
   Just submit a task with a unavailable worker group, you will see the task 
will be delayed for 60s at the first time.
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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