Skip to content

[#1202] improvement: Add HealthScriptChecker for execute special health check shell script - #1203

Merged
zuston merged 5 commits into
apache:masterfrom
xumanbu:1202_script_heath_checker
Sep 22, 2023
Merged

[#1202] improvement: Add HealthScriptChecker for execute special health check shell script#1203
zuston merged 5 commits into
apache:masterfrom
xumanbu:1202_script_heath_checker

Conversation

@xumanbu

@xumanbu xumanbu commented Sep 21, 2023

Copy link
Copy Markdown
Contributor

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 seconds

How was this patch tested?

add ut

@roryqi

roryqi commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

Could you add some documents for this pr?

file.setExecutable(true);
return file.canExecute();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add license header for this file?

@@ -0,0 +1,2 @@
#!/usr/bin/env bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exe -> execution ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

// 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();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the ExitCodeException will be thrown when the execution failed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if shell execute stopped exit 1, throw ExitCodeException. I'll add a test case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@roryqi roryqi changed the title [#1202] improvement: add HealthScriptChecker for execute special health check shell script [#1202] improvement: Add HealthScriptChecker for execute special health check shell script Sep 22, 2023
@xumanbu

xumanbu commented Sep 22, 2023

Copy link
Copy Markdown
Contributor Author

Could you add some documents for this pr?

I'll done

@roryqi

roryqi commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

Could you add some documents for this pr?

I'll done

Could you add the document in the https://github.com/apache/incubator-uniffle/blob/master/docs/server_guide.md ?

@codecov-commenter

codecov-commenter commented Sep 22, 2023

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 85.10638% with 7 lines in your changes missing coverage. Please review.

Project coverage is 54.84%. Comparing base (3b37da5) to head (5be5ead).
Report is 508 commits behind head on master.

Files with missing lines Patch % Lines
...org/apache/uniffle/server/HealthScriptChecker.java 81.08% 4 Missing and 3 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@roryqi roryqi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. thanks @zuston @xumanbu

@zuston
zuston merged commit ffb9870 into apache:master Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] HealthScriptChecker support

4 participants