github-advanced-security[bot] commented on code in PR #15292:
URL:
https://github.com/apache/dolphinscheduler/pull/15292#discussion_r1436723777
##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java:
##########
@@ -129,25 +125,25 @@
}
public void killAllRunningTasks() {
- Collection<TaskExecutionContext> taskRequests =
TaskExecutionContextCacheManager.getAllTaskRequestList();
- if (CollectionUtils.isEmpty(taskRequests)) {
+ Collection<WorkerTaskExecutor> workerTaskExecutors =
WorkerTaskExecutorHolder.getAllTaskExecutor();
+ if (CollectionUtils.isEmpty(workerTaskExecutors)) {
return;
}
- log.info("Worker begin to kill all cache task, task size: {}",
taskRequests.size());
+ log.info("Worker begin to kill all cache task, task size: {}",
workerTaskExecutors.size());
int killNumber = 0;
- for (TaskExecutionContext taskRequest : taskRequests) {
+ for (WorkerTaskExecutor workerTaskExecutor : workerTaskExecutors) {
// kill task when it's not finished yet
try {
-
LogUtils.setWorkflowAndTaskInstanceIDMDC(taskRequest.getProcessInstanceId(),
- taskRequest.getTaskInstanceId());
- if (ProcessUtils.kill(taskRequest)) {
+ TaskExecutionContext taskExecutionContext =
workerTaskExecutor.getTaskExecutionContext();
+
LogUtils.setTaskInstanceIdMDC(taskExecutionContext.getTaskInstanceId());
+ if (ProcessUtils.kill(taskExecutionContext)) {
Review Comment:
## Deprecated method or constructor invocation
Invoking [ProcessUtils.kill](1) should be avoided because it has been
deprecated.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3853)
--
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]