You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/04/06 02:48:03 UTC
[incubator-dolphinscheduler] branch dev updated:
[Improvement][Worker] Kill task error(#5199) (#5212)
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 4a1303b [Improvement][Worker] Kill task error(#5199) (#5212)
4a1303b is described below
commit 4a1303b625f3425550636a522ad2e38bd8cae1b7
Author: wenjun <86...@qq.com>
AuthorDate: Tue Apr 6 10:47:53 2021 +0800
[Improvement][Worker] Kill task error(#5199) (#5212)
---
.../org/apache/dolphinscheduler/server/utils/ProcessUtils.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
index 9e5743e..f7a9991 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
@@ -409,7 +409,7 @@ public class ProcessUtils {
* @throws Exception exception
*/
public static String getPidsStr(int processId) throws Exception {
- StringBuilder sb = new StringBuilder();
+ List<String> pidList = new ArrayList<>();
Matcher mat = null;
// pstree pid get sub pids
if (OSUtils.isMacOS()) {
@@ -424,11 +424,14 @@ public class ProcessUtils {
if (null != mat) {
while (mat.find()) {
- sb.append(mat.group(1)).append(" ");
+ pidList.add(mat.group(1));
}
}
- return sb.toString().trim();
+ if (CommonUtils.isSudoEnable() && !pidList.isEmpty()) {
+ pidList = pidList.subList(1, pidList.size());
+ }
+ return String.join(" ", pidList).trim();
}
/**