-
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
[FIX-3900][server] kill multi yarn app in one job #4042
Conversation
...hinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
Show resolved
Hide resolved
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.
some code smell can be wiped out.
...hinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
Outdated
Show resolved
Hide resolved
...hinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
Show resolved
Hide resolved
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.
two magic number.
Codecov Report
@@ Coverage Diff @@
## dev #4042 +/- ##
============================================
+ Coverage 39.39% 39.49% +0.10%
- Complexity 2968 2981 +13
============================================
Files 467 467
Lines 22104 22113 +9
Branches 2712 2714 +2
============================================
+ Hits 8708 8734 +26
+ Misses 12589 12570 -19
- Partials 807 809 +2
Continue to review full report at Codecov.
|
FileUtils.writeStringToFile(new File(commandFile), sb.toString(), StandardCharsets.UTF_8); | ||
} | ||
|
||
String runCmd = "sh " + commandFile; |
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.
is this "sh " can be instead?
I can find it elsewhere.
mat = MACPATTERN.matcher(pids); | ||
} | ||
} else { | ||
String pids = OSUtils.exeCmd("pstree -p " + processId); |
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 this "pstree " can be extracted to one variable, then I can easily replace this variable.
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.
other magic numbers exists.
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.
+1
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.
+1
} | ||
|
||
logger.info("kill cmd:{}", runCmd); | ||
Runtime.getRuntime().exec(runCmd); |
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.
please use OSUtils.exeCmd method instead,thx
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.
yes, fixed
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.
don't use Runtime.getRuntime().exec directly, replace with OSUtils.exeCmd, thx
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
|
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.
+1
good job
What is the purpose of the pull request
fix #3900 kill multi yarn app in one job
Brief change log
Verify this pull request