-
Notifications
You must be signed in to change notification settings - Fork 805
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
Add a Tasks manager in chaos daemon for time chaos #2812
Conversation
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Codecov Report
@@ Coverage Diff @@
## master #2812 +/- ##
==========================================
- Coverage 40.74% 40.27% -0.48%
==========================================
Files 147 148 +1
Lines 12047 12230 +183
==========================================
+ Hits 4909 4926 +17
- Misses 6769 6912 +143
- Partials 369 392 +23
Continue to review full report at Codecov.
|
PTAL, @WangXiangUSTC @STRRL |
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
d1bd446
to
c87a17e
Compare
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
# Conflicts: # pkg/time/asset.go
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.
Rest LGTM
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
…TaskConfig Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
…ge data inside the config manager. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
…ge data inside the config manager. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
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.
LGTM
childPids, err := util.GetChildProcesses(uint32(pid), gp.logger) | ||
if err != nil { | ||
gp.logger.Error(err, "failed to get child process") | ||
} |
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.
how about moving these codes after L58, and returning the error when getting child PID failed?
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 agree with you.
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.
Fixed.
childPids, err := util.GetChildProcesses(uint32(pid), gp.logger) | ||
if err != nil { | ||
gp.logger.Error(err, "failed to get child process") | ||
} |
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.
ditto
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 agree with you.
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.
Fixed.
} | ||
|
||
// Addable introduces the data gathering ability. | ||
type Addable interface { |
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.
how about moving this interface after interface Object
? It looks strange to put it in the TaskConfigManager
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.
Fixed.
} | ||
_, ok := m.TaskConfigMap[id] | ||
if !ok { | ||
return errors.Wrapf(ErrTaskConfigNotFound, "UID : %v", id) |
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.
L84 use %s
for uid
, and here use %v
, how about unifying them?
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 agree with you.
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.
Fixed.
if !ok { | ||
return errors.New("task.Data here must implement TaskExecutor") | ||
} | ||
_ = tasker.Assign(process) |
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.
_ = tasker.Assign(process) | |
err = tasker.Assign(process) |
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.
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.
Fixed.
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.
rest LGTM
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
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.
LGTM
/run-e2e-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 8cfb897
|
* Merge tasks manager Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Rollback time changes Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Format Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * some fix Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix license Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix fmt Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add comments Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add comments Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix Merge Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix logger Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix merge Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix merge fmt Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * minor fix Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix comment Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix data -> Data Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix Data -> data Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Change some name & add more comments Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * make name in common error exported Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * make NotFound.Name unexported & Add some global variable&XXXTask->XXXTaskConfig Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add more test. & Fix a bug that user can give a config pointer & change data inside the config manager. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add more test. & Fix a bug that user can give a config pointer & change data inside the config manager. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * make error not found just a func Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix comment. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix comment. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix merge. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fmt Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
* Merge tasks manager Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Rollback time changes Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Format Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * some fix Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix license Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix fmt Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add comments Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add comments Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix Merge Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix logger Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix merge Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix merge fmt Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * minor fix Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix comment Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix data -> Data Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fix Data -> data Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Change some name & add more comments Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * make name in common error exported Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * make NotFound.Name unexported & Add some global variable&XXXTask->XXXTaskConfig Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add more test. & Fix a bug that user can give a config pointer & change data inside the config manager. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Add more test. & Fix a bug that user can give a config pointer & change data inside the config manager. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * make error not found just a func Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix comment. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix comment. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * Fix merge. Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> * fmt Signed-off-by: andrewmatilde <davis6813585853062@outlook.com> Signed-off-by: zhqqqy <zhqqqy@163.com>
What problem does this PR solve?
I need a tasks manager to organize tasks on process in time chaos.
What's changed and how it works?
Nothing changes now , I just add a manager .
I will apply it on time chaos later.
Related changes
No related changes
Checklist
Tests
Side effects
Release note
DCO
If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it: