github-advanced-security[bot] commented on code in PR #15278:
URL:
https://github.com/apache/dolphinscheduler/pull/15278#discussion_r1415331660
##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/runner/WorkerExecService.java:
##########
@@ -90,7 +84,7 @@
return ((ThreadPoolExecutor) this.execService).getActiveCount();
}
- public Map<Integer, WorkerTaskExecuteRunnable> getTaskExecuteThreadMap() {
+ public Map<Integer, WorkerTaskExecutor> getTaskExecuteThreadMap() {
Review Comment:
## Exposing internal representation
getTaskExecuteThreadMap exposes the internal representation stored in field
taskExecuteThreadMap. The value may be modified [after this call to
getTaskExecuteThreadMap](1).
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3684)
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/PriorityDelayTaskExecuteRunnable.java:
##########
@@ -15,62 +15,57 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.server.master.runner.execute;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+package org.apache.dolphinscheduler.server.master.runner;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
-import org.jetbrains.annotations.NotNull;
-
-public abstract class PriorityTaskExecuteRunnable implements
TaskExecuteRunnable, Comparable<TaskExecuteRunnable> {
-
- private final ProcessInstance workflowInstance;
- private final TaskInstance taskInstance;
- private final TaskExecutionContext taskExecutionContext;
-
- public PriorityTaskExecuteRunnable(ProcessInstance workflowInstance,
- TaskInstance taskInstance,
- TaskExecutionContext
taskExecutionContext) {
- this.taskInstance = checkNotNull(taskInstance);
- this.workflowInstance = checkNotNull(workflowInstance);
- this.taskExecutionContext = checkNotNull(taskExecutionContext);
- }
+import java.util.concurrent.Delayed;
+import java.util.concurrent.TimeUnit;
- @Override
- public ProcessInstance getWorkflowInstance() {
- return workflowInstance;
- }
+public abstract class PriorityDelayTaskExecuteRunnable extends
BaseTaskExecuteRunnable implements Delayed {
Review Comment:
## Inconsistent compareTo
This class declares [compareTo](1) but inherits equals; the two could be
inconsistent.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3688)
--
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]