NodeHealthScriptRunner does not report a bad health if the script exits with an exit code other than 0. Look at the FAILED_WITH_EXIT_CODE case:
Based on the discussion in
YARN-5567, this is intentional, but conflicts with the upstream document, which says:
"If the script exits with a non-zero exit code, times out or results in an exception being thrown, the node is marked as unhealthy"
This statement can be extremely misleading and must be corrected. We might also add an extra comment to reportHealthStatus() which explains that FAILED_WITH_EXIT_CODE is not buggy.
This case also lacks unit test coverage.