njnu-seafish commented on code in PR #17796:
URL:
https://github.com/apache/dolphinscheduler/pull/17796#discussion_r2715661397
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java:
##########
@@ -97,6 +99,18 @@ public void validate(Object target, Errors errors) {
if (masterConfig.getWorkerGroupRefreshInterval().getSeconds() < 10) {
errors.rejectValue("worker-group-refresh-interval", null, "should
>= 10s");
}
+
+ TaskDispatchPolicy dispatchPolicy =
masterConfig.getTaskDispatchPolicy();
+ if (dispatchPolicy != null &&
dispatchPolicy.isDispatchTimeoutFailedEnabled()) {
+ if (dispatchPolicy.getMaxTaskDispatchDuration() == null) {
+
errors.rejectValue("dispatch-timeout-checker.max-task-dispatch-duration", null,
+ "must be specified when dispatch timeout checker is
enabled");
+ } else if (dispatchPolicy.getMaxTaskDispatchDuration().toMillis()
<= 0) {
+
errors.rejectValue("dispatch-timeout-checker.max-task-dispatch-duration", null,
+ "must be a positive duration (e.g., '2m', '5m',
'30m')");
+ }
+ }
Review Comment:
> Can dispatchPolicy be null?
It indeed cannot be null.
private TaskDispatchPolicy taskDispatchPolicy = new TaskDispatchPolicy();
--
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]