Skip to content
Snippets Groups Projects
Commit 1739e75f authored by Marcelo Vanzin's avatar Marcelo Vanzin
Browse files

[SPARK-16586][CORE] Handle JVM errors printed to stdout.

Some very rare JVM errors are printed to stdout, and that confuses
the code in spark-class. So add a check so that those cases are
detected and the proper error message is shown to the user.

Tested by running spark-submit after setting "ulimit -v 32000".

Closes #14231

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #14508 from vanzin/SPARK-16586.
parent 5959df21
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,15 @@ done < <(build_command "$@") ...@@ -80,6 +80,15 @@ done < <(build_command "$@")
COUNT=${#CMD[@]} COUNT=${#CMD[@]}
LAST=$((COUNT - 1)) LAST=$((COUNT - 1))
LAUNCHER_EXIT_CODE=${CMD[$LAST]} LAUNCHER_EXIT_CODE=${CMD[$LAST]}
# Certain JVM failures result in errors being printed to stdout (instead of stderr), which causes
# the code that parses the output of the launcher to get confused. In those cases, check if the
# exit code is an integer, and if it's not, handle it as a special error case.
if ! [[ $LAUNCHER_EXIT_CODE =~ ^[0-9]+$ ]]; then
echo "${CMD[@]}" | head -n-1 1>&2
exit 1
fi
if [ $LAUNCHER_EXIT_CODE != 0 ]; then if [ $LAUNCHER_EXIT_CODE != 0 ]; then
exit $LAUNCHER_EXIT_CODE exit $LAUNCHER_EXIT_CODE
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment