You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by techaddict <gi...@git.apache.org> on 2014/05/04 11:41:38 UTC

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

GitHub user techaddict opened a pull request:

    https://github.com/apache/spark/pull/630

    SPARK-1710: spark-submit should print better errors than "InvocationTargetException"

    Catching the InvocationTargetException, printing getTargetException.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/techaddict/spark SPARK-1710

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/630.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #630
    
----
commit 109d6042351b94d777c7c3df5e4e47b689c90015
Author: Sandeep <sa...@techaddict.me>
Date:   2014-05-04T09:35:57Z

    SPARK-1710: spark-submit should print better errors than "InvocationTargetException"

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/630


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42157371
  
    LGTM - I built and tested this locally and it worked well:
    
    ```
    ./bin/spark-submit --class org.apache.spark.examples.SparkPi examples/target/scala-2.10/spark-examples-1.0.0-SNAPSHOT-hadoop1.0.4.jar blahbal 100
    ...
    ...
    Exception in thread "main" org.apache.spark.SparkException: Could not parse Master URL: 'blahbal'
    	at org.apache.spark.SparkContext$.org$apache$spark$SparkContext$$createTaskScheduler(SparkContext.scala:1552)
    	at org.apache.spark.SparkContext.<init>(SparkContext.scala:302)
    	at org.apache.spark.SparkContext.<init>(SparkContext.scala:111)
    	at org.apache.spark.SparkContext.<init>(SparkContext.scala:148)
    	at org.apache.spark.examples.SparkPi$.main(SparkPi.scala:31)
    	at org.apache.spark.examples.SparkPi.main(SparkPi.scala)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:606)
    	at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:258)
    	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:55)
    	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42128790
  
    Merged build started. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by techaddict <gi...@git.apache.org>.
Github user techaddict commented on a diff in the pull request:

    https://github.com/apache/spark/pull/630#discussion_r12260772
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -253,7 +254,12 @@ object SparkSubmit {
     
         val mainClass = Class.forName(childMainClass, true, loader)
         val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
    -    mainMethod.invoke(null, childArgs.toArray)
    +    try {
    +      mainMethod.invoke(null, childArgs.toArray)
    +    } catch {
    +      case e: InvocationTargetException =>
    +        println("Exception in Invoked Method" + e.getTargetException)
    --- End diff --
    
    Any ideas on how to handle null ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42129493
  
    Merged build finished. All automated tests passed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/630#discussion_r12260752
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -253,7 +254,12 @@ object SparkSubmit {
     
         val mainClass = Class.forName(childMainClass, true, loader)
         val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
    -    mainMethod.invoke(null, childArgs.toArray)
    +    try {
    +      mainMethod.invoke(null, childArgs.toArray)
    +    } catch {
    +      case e: InvocationTargetException =>
    +        println("Exception in Invoked Method" + e.getTargetException)
    --- End diff --
    
    I think this is going to change behavior in two ways though. This will not print any stack trace, and the exception will not propagated up to main() where it will terminate the program with a non-zero status. Both of those seems like good normal things. Instead, just `throw e.getTargetException`? (I suppose it would be even better to handle the case of a `null` target, but that is not supposed to happen in normal use.)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42130788
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14643/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42130100
  
    Merged build started. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/630#discussion_r12260839
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -253,7 +254,12 @@ object SparkSubmit {
     
         val mainClass = Class.forName(childMainClass, true, loader)
         val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
    -    mainMethod.invoke(null, childArgs.toArray)
    +    try {
    +      mainMethod.invoke(null, childArgs.toArray)
    +    } catch {
    +      case e: InvocationTargetException =>
    +        println("Exception in Invoked Method" + e.getTargetException)
    --- End diff --
    
    How about:
    
    ```
      case e: InvocationTargetException => e.getCause match {
        case cause: Throwable => throw cause
        case null => throw e
      }
    ```
    
    (`getCause` is a little more standard)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42130787
  
    Merged build finished. All automated tests passed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42130099
  
     Merged build triggered. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42129494
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14642/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by techaddict <gi...@git.apache.org>.
Github user techaddict commented on a diff in the pull request:

    https://github.com/apache/spark/pull/630#discussion_r12260879
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -253,7 +254,12 @@ object SparkSubmit {
     
         val mainClass = Class.forName(childMainClass, true, loader)
         val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
    -    mainMethod.invoke(null, childArgs.toArray)
    +    try {
    +      mainMethod.invoke(null, childArgs.toArray)
    +    } catch {
    +      case e: InvocationTargetException =>
    +        println("Exception in Invoked Method" + e.getTargetException)
    --- End diff --
    
    better :+1: 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42128788
  
     Merged build triggered. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-1710: spark-submit should print better e...

Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:

    https://github.com/apache/spark/pull/630#issuecomment-42157435
  
    I've merged this - thanks!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---