-
Notifications
You must be signed in to change notification settings - Fork 5k
[Improvement-17795][Master] Add dispatch timeout checking logic to handle cases where the worker group does not exist or no workers are available #17796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
njnu-seafish
wants to merge
48
commits into
apache:dev
Choose a base branch
from
njnu-seafish:Improvement-17795
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+728
−18
Open
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
00b8dc6
Add dispatch timeout checking logic
bb089f3
add dispatch-timeout-checker switch
fbd7edf
add dispatch-timeout-checker switch
ab84035
update ExceptionUtils
f193af6
add test for dispatch timeout checker
ab750bb
Merge branch 'apache:dev' into Improvement-17795
njnu-seafish 584ad2d
add TaskFatalLifecycleEvent and handler
877db06
add TaskFatalLifecycleEvent and handler
cb44db7
Add dispatch timeout checking logic
1aa12df
add dispatch-timeout-checker switch
0c29a82
add dispatch-timeout-checker switch
6ad77d1
update ExceptionUtils
b760003
add test for dispatch timeout checker
39b40c1
add TaskFatalLifecycleEvent and handler
d7bf4fa
add TaskFatalLifecycleEvent and handler
0c8c93e
Merge branch 'apache:dev' into Improvement-17795
njnu-seafish 5e1dd52
Merge branch 'Improvement-17795' of github.com:njnu-seafish/dolphinsc…
5b2722d
update TaskDispatchPolicy
33c16e8
add it test case
3c25528
Merge branch 'dev' into Improvement-17795
njnu-seafish 99a5d7c
update test
9966047
Merge branch 'Improvement-17795' of github.com:njnu-seafish/dolphinsc…
42a5aa2
Merge branch 'apache:dev' into Improvement-17795
njnu-seafish 879ba5e
update test
77a5dfa
Merge branch 'dev' into Improvement-17795
njnu-seafish 9a6d664
Merge branch 'dev' into Improvement-17795
ruanwenjun cca935f
Merge branch 'apache:dev' into Improvement-17795
njnu-seafish e49549e
update test
b5a703b
update test
9f97478
Remove this test case and track the fix in a separate issue
ddb7eb7
add it test case by using SHELL task
93e398c
update test comment
6864a2e
Merge branch 'dev' into Improvement-17795
njnu-seafish f7c7fe1
update task instance state
7437249
remove masterContainer.assertAllResourceReleased if workflow is running
99d2640
update test
a6302d3
Merge branch 'dev' into Improvement-17795
njnu-seafish 7a01fab
Resolve merge conflicts from dev branch
8c4700a
update test
d6f8ccd
update test
5a47e02
Merge branch 'apache:dev' into Improvement-17795
njnu-seafish 743dcbc
remove redundant tests and comments
62cfb30
remove redundant comments
edf818c
Merge branch 'apache:dev' into Improvement-17795
njnu-seafish f772a55
update comment and test
5f19c7b
update test
e12af5d
Merge branch 'dev' into Improvement-17795
njnu-seafish 65e7359
add dispatch timeout config in doc
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...er/src/main/java/org/apache/dolphinscheduler/server/master/config/TaskDispatchPolicy.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.dolphinscheduler.server.master.config; | ||
|
|
||
| import java.time.Duration; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| /** | ||
| * Configuration for the master's task dispatch policy. | ||
| * When enabled, tasks that remain in the dispatch queue longer than | ||
| * {@link #maxTaskDispatchDuration} will be marked as failed to prevent indefinite queuing. | ||
| */ | ||
| @Data | ||
| public class TaskDispatchPolicy { | ||
|
|
||
| /** | ||
| * Indicates whether the dispatch timeout checking mechanism is enabled. | ||
| */ | ||
| private boolean dispatchTimeoutEnabled = false; | ||
|
|
||
| /** | ||
| * The maximum allowed duration a task may wait in the dispatch queue before being assigned to a worker. | ||
| * Tasks that exceed this duration will be marked as failed. | ||
| * Examples: {@code "10m"}, {@code "30m"}, {@code "1h"}. | ||
| */ | ||
| private Duration maxTaskDispatchDuration; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
.../apache/dolphinscheduler/server/master/exception/dispatch/NoAvailableWorkerException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.dolphinscheduler.server.master.exception.dispatch; | ||
|
|
||
| public class NoAvailableWorkerException extends TaskDispatchException { | ||
|
|
||
| public NoAvailableWorkerException(String workerGroup) { | ||
| super("Cannot find available worker under worker group: " + workerGroup); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add to the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, add it.