You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by va...@apache.org on 2016/08/08 17:35:00 UTC

spark git commit: [SPARK-16586][CORE] Handle JVM errors printed to stdout.

Repository: spark
Updated Branches:
  refs/heads/master 5959df217 -> 1739e75fe


[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 <va...@cloudera.com>

Closes #14508 from vanzin/SPARK-16586.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1739e75f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1739e75f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1739e75f

Branch: refs/heads/master
Commit: 1739e75fecf0cb9507dc950bba1716f40be1e609
Parents: 5959df2
Author: Marcelo Vanzin <va...@cloudera.com>
Authored: Mon Aug 8 10:34:54 2016 -0700
Committer: Marcelo Vanzin <va...@cloudera.com>
Committed: Mon Aug 8 10:34:54 2016 -0700

----------------------------------------------------------------------
 bin/spark-class | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1739e75f/bin/spark-class
----------------------------------------------------------------------
diff --git a/bin/spark-class b/bin/spark-class
index 658e076..377c8d1 100755
--- a/bin/spark-class
+++ b/bin/spark-class
@@ -80,6 +80,15 @@ done < <(build_command "$@")
 COUNT=${#CMD[@]}
 LAST=$((COUNT - 1))
 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
   exit $LAUNCHER_EXIT_CODE
 fi


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org