spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srowen <>
Subject [GitHub] spark pull request #14231: [SPARK-16586] Change the way the exit code of lau...
Date Wed, 27 Jul 2016 10:04:34 GMT
Github user srowen commented on a diff in the pull request:
    --- Diff: bin/spark-class ---
    @@ -65,24 +65,25 @@ fi
     # characters that would be otherwise interpreted by the shell. Read that in a while loop,
     # an array that will be used to exec the final command.
    -# The exit code of the launcher is appended to the output, so the parent shell removes
it from the
    -# command array and checks the value to see if the launcher succeeded.
    -build_command() {
    -  "$RUNNER" -Xmx128m -cp "$LAUNCH_CLASSPATH" org.apache.spark.launcher.Main "$@"
    -  printf "%d\0" $?
    +# To keep both the output and the exit code of the launcher, the output is first converted
to a hex
    +# dump which prevents the bash from getting rid of the NULL character, and the exit code
    +# from the bash array ${PIPESTATUS[@]}.
    +# Note that the seperator NULL character can not be replace with space or '\n' so that
the command
    +# won't fail if some path of the user contain special characher such as '\n' or space
    +# Also note that when the launcher fails, it might not output something ending with '\0'
    +_CMD=$("$RUNNER" -Xmx128m -cp "$LAUNCH_CLASSPATH" org.apache.spark.launcher.Main "$@"|xxd
-p|tr -d '\n';exit ${PIPESTATUS[0]})
    --- End diff --
    But isnt that a much simpler two line change? I don't see why it requires all this. Just
check the exit status immediately after the launcher and exit if not zero.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message