From 6248cda98a193743831e2a05c9ab7968c659b083 Mon Sep 17 00:00:00 2001 From: JohnZp <455482064@qq.com> Date: Mon, 5 Feb 2024 16:16:40 +0800 Subject: [PATCH] [fix][task-api]:Fix the issue where execution is not successful in resource limit mode --- .../task/api/shell/BaseLinuxShellInterceptorBuilder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/BaseLinuxShellInterceptorBuilder.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/BaseLinuxShellInterceptorBuilder.java index afc2edc586..5f6522cc7f 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/BaseLinuxShellInterceptorBuilder.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/shell/BaseLinuxShellInterceptorBuilder.java @@ -125,7 +125,8 @@ public abstract class BaseLinuxShellInterceptorBuilder bootstrapCommandInSudoMode() { - if (PropertyUtils.getBoolean(AbstractCommandExecutorConstants.TASK_RESOURCE_LIMIT_STATE, false)) { + if (PropertyUtils.getBoolean(AbstractCommandExecutorConstants.TASK_RESOURCE_LIMIT_STATE, false) + && (memoryQuota != -1 || cpuQuota != -1)) { return bootstrapCommandInResourceLimitMode(); } List bootstrapCommand = new ArrayList<>(); @@ -164,13 +165,15 @@ public abstract class BaseLinuxShellInterceptorBuilder