-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
disttask: add finish flow for distribute framework #43676
Merged
Merged
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fefc43a
disttask: add finish flow for distribute framwork
GMHDBJD 621fb15
fix ut
GMHDBJD 5090506
address comment
GMHDBJD bda851c
update
GMHDBJD ac1a517
Merge remote-tracking branch 'upstream/master' into addFinishFlow
GMHDBJD 7409d80
address comment
GMHDBJD d111466
Merge remote-tracking branch 'upstream/master' into addFinishFlow
GMHDBJD 8332da0
address comment
GMHDBJD 9c2624e
add process finish flow
GMHDBJD 74f7e26
fix
GMHDBJD 899437d
Merge remote-tracking branch 'upstream/master' into addFinishFlow
GMHDBJD 6cfe8c6
Revert "fix"
GMHDBJD 7b69d73
Revert "add process finish flow"
GMHDBJD e67e230
move func to dispatcher handle
GMHDBJD fc6f1e6
update
GMHDBJD 76f8c68
update
GMHDBJD b85b9a2
add log
GMHDBJD File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -69,6 +69,12 @@ func (t *MockTaskTable) UpdateSubtaskStateAndError(id int64, state string, _ str | |
return args.Error(0) | ||
} | ||
|
||
// FinishSubtask implements SubtaskTable.FinishSubtask | ||
func (t *MockTaskTable) FinishSubtask(id int64, meta []byte) error { | ||
args := t.Called(id, meta) | ||
return args.Error(0) | ||
} | ||
|
||
// HasSubtasksInStates implements SubtaskTable.HasSubtasksInStates. | ||
func (t *MockTaskTable) HasSubtasksInStates(instanceID string, taskID int64, states ...interface{}) (bool, error) { | ||
args := t.Called(instanceID, taskID, states) | ||
|
@@ -133,9 +139,12 @@ func (m *MockScheduler) SplitSubtask(ctx context.Context, subtask []byte) ([]pro | |
} | ||
|
||
// OnSubtaskFinished implements Scheduler.OnSubtaskFinished. | ||
func (m *MockScheduler) OnSubtaskFinished(ctx context.Context, subtask []byte) error { | ||
func (m *MockScheduler) OnSubtaskFinished(ctx context.Context, subtask []byte) ([]byte, error) { | ||
args := m.Called(ctx, subtask) | ||
return args.Error(0) | ||
if args.Error(1) != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this file manually mocked? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I will change to generated in another pr |
||
return nil, args.Error(1) | ||
} | ||
return args.Get(0).([]byte), nil | ||
} | ||
|
||
// CleanupSubtaskExecEnv implements Scheduler.CleanupSubtaskExecEnv. | ||
|
This file contains 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 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 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 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 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.
I think we can put
processFinishFlow
directly, and only import step2 or other special step needs to do this.