-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Improvement] Remove taskQueue and looper in worker #15292
[Improvement] Remove taskQueue and looper in worker #15292
Conversation
b43261d
to
c783836
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #15292 +/- ##
============================================
+ Coverage 37.80% 38.10% +0.29%
- Complexity 4681 4698 +17
============================================
Files 1304 1301 -3
Lines 44937 44800 -137
Branches 4812 4800 -12
============================================
+ Hits 16990 17071 +81
+ Misses 26098 25877 -221
- Partials 1849 1852 +3 ☔ View full report in Codecov by Sentry. |
c783836
to
7f77e6c
Compare
1782419
to
79d2e34
Compare
// todo: remove this method | ||
ThreadPoolExecutor getThreadPool() { | ||
return threadPoolExecutor; | ||
} | ||
} |
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.
Can you add more comments for it? You added this method but the todo is the remove method, which seems a bit strange.
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.
Done.
@@ -128,26 +107,4 @@ public void stop(String cause) { | |||
close(cause); | |||
} | |||
|
|||
public void killAllRunningTasks() { |
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 keep this method to make sure all task are canceled when worker down, WDYT?
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, I keep this method, and add todo.
Please add some pr description. |
79d2e34
to
30a5d41
Compare
Done |
30a5d41
to
7dc5447
Compare
if (ProcessUtils.kill(taskRequest)) { | ||
TaskExecutionContext taskExecutionContext = workerTaskExecutor.getTaskExecutionContext(); | ||
LogUtils.setTaskInstanceIdMDC(taskExecutionContext.getTaskInstanceId()); | ||
if (ProcessUtils.kill(taskExecutionContext)) { |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
ProcessUtils.kill
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
7dc5447
to
283d52d
Compare
Quality Gate failedFailed conditions 17.1% Coverage on New Code (required ≥ 60%) |
Purpose of the pull request
Since we have put the
delay
logic from worker to master, there is no need to add task queue in worker, this will cause it's not convenient to judge the task size, and we need to use a thread to loop the task queue.This pr will remove the extra task queue in worker, directly use the thread pool's queue as task queue.
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md