Skip to content

Conversation

@scwf
Copy link
Contributor

@scwf scwf commented Aug 8, 2014

https://issues.apache.org/jira/browse/SPARK-2925

Run cmd like this will get the error
bin/spark-sql --driver-java-options '-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=y'

Error: Unrecognized option '-Xnoagent'.
Run with --help for usage help or --verbose for debug output

@scwf scwf changed the title [SPARK-2925] fix spark-sql error when set --driver-java-options [SPARK-2925] [sql]fix spark-sql error when set --driver-java-options Aug 8, 2014
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@scwf scwf changed the title [SPARK-2925] [sql]fix spark-sql error when set --driver-java-options [SPARK-2925] [sql]fix spark-sql and start-thriftserver bugs when set --driver-java-options Aug 8, 2014
@scwf
Copy link
Contributor Author

scwf commented Aug 8, 2014

start-thriftserver also has the problem, fixed it

@scwf scwf changed the title [SPARK-2925] [sql]fix spark-sql and start-thriftserver bugs when set --driver-java-options [SPARK-2925] [sql]fix spark-sql and start-thriftserver shell bugs when set --driver-java-options Aug 8, 2014
@scwf
Copy link
Contributor Author

scwf commented Aug 11, 2014

@marmbrus, can you verify this pr?

@marmbrus
Copy link
Contributor

test this please

@marmbrus
Copy link
Contributor

/cc @liancheng

@SparkQA
Copy link

SparkQA commented Aug 11, 2014

QA tests have started for PR 1851. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/18293/consoleFull

@SparkQA
Copy link

SparkQA commented Aug 11, 2014

QA results for PR 1851:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/18293/consoleFull

@liancheng
Copy link
Contributor

@scwf Bash escaping is really annoying... Thanks for spotting and fixing this issue! This PR fixed the --driver-java-options option, but any other options that may accept quoted string with spaces still suffer this issue.

The root cause here is that variables in these two scripts are not properly quoted. We should quote them to fix all similar cases. Take bin/spark-sql as an example, all CLI_ARGS+=($1) and CLI_ARGS+=(\"$1\") should be CLI_ARGS+=("$1"), and the last line

eval exec "$FWDIR"/bin/spark-submit --class $CLASS ${SUBMISSION_ARGS[*]} spark-internal ${CLI_ARGS[*]}

should be

exec "$FWDIR"/bin/spark-submit --class $CLASS "${SUBMISSION_ARGS[@]}" spark-internal "${CLI_ARGS[@]}"

The same rules applies to sbin/start-thriftserver.sh.

@scwf
Copy link
Contributor Author

scwf commented Aug 12, 2014

@liancheng, using CLI_ARGS+=("$1") , "${SUBMISSION_ARGS[@]}" and "${CLI_ARGS[@]}" can not fix this issue, i think there are only two options may leads to the problem:

  1. -e quoted-query-string , now the bash is ok for this option because it use CLI_ARGS+=("$1")
  2. --driver-java-options java options, this pr fixed it
    so we only need handle --driver-java-options issue

@liancheng
Copy link
Contributor

PR #1886 uses similar approach I mentioned above. I tested both -e and your --driver-java-options cases locally with #1886, and they seem working. My environment is Mac OS X 10.9 + Bash 4.3.18. (Please note that the eval is removed.)

@scwf
Copy link
Contributor Author

scwf commented Aug 12, 2014

@liancheng yeah, my mistake , we should also use SUBMISSION_ARGS+=("$1") to instead SUBMISSION_ARGS+=($1) , it will be ok

@scwf
Copy link
Contributor Author

scwf commented Aug 12, 2014

updated

@marmbrus
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Aug 12, 2014

QA tests have started for PR 1851. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/18354/consoleFull

@marmbrus
Copy link
Contributor

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Aug 13, 2014

QA tests have started for PR 1851. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/18486/consoleFull

@scwf
Copy link
Contributor Author

scwf commented Aug 14, 2014

@marmbrus, the test failures but it seems error when running PySpark tests. And the jenkins seems not post tests result to Github. Can you suggest for that?

@liancheng
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Aug 14, 2014

QA tests have started for PR 1851. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/18540/consoleFull

@marmbrus
Copy link
Contributor

Tests passed but failed to post to github.

I'm going to merge this to master and 1.1. Thanks!

asfgit pushed a commit that referenced this pull request Aug 14, 2014
…n set --driver-java-options

https://issues.apache.org/jira/browse/SPARK-2925

Run cmd like this will get the error
bin/spark-sql --driver-java-options '-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=y'

Error: Unrecognized option '-Xnoagent'.
Run with --help for usage help or --verbose for debug output

Author: wangfei <[email protected]>
Author: wangfei <[email protected]>

Closes #1851 from scwf/patch-2 and squashes the following commits:

516554d [wangfei] quote variables to fix this issue
8bd40f2 [wangfei] quote variables to fix this problem
e6d79e3 [wangfei] fix start-thriftserver bug when set driver-java-options
948395d [wangfei] fix spark-sql error when set --driver-java-options

(cherry picked from commit 267fdff)
Signed-off-by: Michael Armbrust <[email protected]>
@asfgit asfgit closed this in 267fdff Aug 14, 2014
@scwf scwf deleted the patch-2 branch August 22, 2014 15:20
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
…n set --driver-java-options

https://issues.apache.org/jira/browse/SPARK-2925

Run cmd like this will get the error
bin/spark-sql --driver-java-options '-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=y'

Error: Unrecognized option '-Xnoagent'.
Run with --help for usage help or --verbose for debug output

Author: wangfei <[email protected]>
Author: wangfei <[email protected]>

Closes apache#1851 from scwf/patch-2 and squashes the following commits:

516554d [wangfei] quote variables to fix this issue
8bd40f2 [wangfei] quote variables to fix this problem
e6d79e3 [wangfei] fix start-thriftserver bug when set driver-java-options
948395d [wangfei] fix spark-sql error when set --driver-java-options
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.

5 participants