[#1202] improvement: Add HealthScriptChecker for execute special health check shell script - #1203
Conversation
…l health check shell script
|
Could you add some documents for this pr? |
| file.setExecutable(true); | ||
| return file.canExecute(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Could you remove extra blank line?
| @@ -0,0 +1,2 @@ | |||
| #!/usr/bin/env bash | |||
| echo "NORMAL: Check Disk is Normal" No newline at end of file | |||
There was a problem hiding this comment.
Could you add license header for this file?
| @@ -0,0 +1,2 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Could you add license header for this file?
| "The health script file path for HealthScriptChecker, if script file should have execute permission."); | ||
|
|
||
| public static final ConfigOption<Long> HEALTH_CHECKER_SCRIPT_EXE_TIMEOUT = | ||
| ConfigOptions.key("rss.server.health.checker.script.exe.timeout") |
| // always build executor is to load the latest script, the script file can update in need. | ||
| Shell.ShellCommandExecutor commandExecutor = new Shell.ShellCommandExecutor(new String[] {healthScriptPath}, null, null, scriptTimeout); | ||
| try { | ||
| commandExecutor.execute(); |
There was a problem hiding this comment.
So the ExitCodeException will be thrown when the execution failed?
There was a problem hiding this comment.
if shell execute stopped exit 1, throw ExitCodeException. I'll add a test case.
I'll done |
Could you add the document in the https://github.com/apache/incubator-uniffle/blob/master/docs/server_guide.md ? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1203 +/- ##
============================================
+ Coverage 53.67% 54.84% +1.17%
- Complexity 2587 2597 +10
============================================
Files 391 372 -19
Lines 22427 20114 -2313
Branches 1875 1884 +9
============================================
- Hits 12037 11032 -1005
+ Misses 9684 8444 -1240
+ Partials 706 638 -68 ☔ View full report in Codecov by Sentry. |
What changes were proposed in this pull request?
add HealthScriptChecker for execute special health check shell script
ref: https://github.com/apache/hadoop/blob/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/health/NodeHealthScriptRunner.java
Why are the changes needed?
Fix: #1202
Does this PR introduce any user-facing change?
rss.server.health.checker.script.path: The health script file path for HealthScriptChecker, if script file should have execute permission.rss.server.health.checker.script.exe.timeout: The health script file execute timeout secondsHow was this patch tested?
add ut