You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by felixcheung <gi...@git.apache.org> on 2017/01/16 00:37:16 UTC

[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

GitHub user felixcheung opened a pull request:

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

    [SPARK-19231][SPARKR] add error handling for download and untar for Spark release

    ## What changes were proposed in this pull request?
    
    When R is starting as a package and it needs to download the Spark release distribution we need to handle error for download and untar, and clean up, otherwise it will get stuck.
    
    ## How was this patch tested?
    
    manually


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

    $ git pull https://github.com/felixcheung/spark rtarreturncode

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

    https://github.com/apache/spark/pull/16589.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 #16589
    
----
commit 9b21c1125998b09607dc40c57dcd579d322b6f6e
Author: Felix Cheung <fe...@hotmail.com>
Date:   2017-01-16T00:30:05Z

    add error handling for download and untar

----


---
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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96567761
  
    --- Diff: R/pkg/R/install.R ---
    @@ -201,14 +221,20 @@ directDownloadTar <- function(mirrorUrl, version, hadoopVersion, packageName, pa
       msg <- sprintf(fmt, version, ifelse(hadoopVersion == "without", "Free build", hadoopVersion),
                      packageRemotePath)
       message(msg)
    -  downloadUrl(packageRemotePath, packageLocalPath, paste0("Fetch failed from ", mirrorUrl))
    +  downloadUrl(packageRemotePath, packageLocalPath)
    --- End diff --
    
    I didn't relate this to the update in L176 - I think this is fine. In general I think this file has gotten a little unwieldy with error messages coming from different functions. I wonder if there is a better way to refactor things to setup some expectations on where errors are thrown etc.


---
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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96285488
  
    --- Diff: R/pkg/R/install.R ---
    @@ -201,14 +221,20 @@ directDownloadTar <- function(mirrorUrl, version, hadoopVersion, packageName, pa
       msg <- sprintf(fmt, version, ifelse(hadoopVersion == "without", "Free build", hadoopVersion),
                      packageRemotePath)
       message(msg)
    -  downloadUrl(packageRemotePath, packageLocalPath, paste0("Fetch failed from ", mirrorUrl))
    +  downloadUrl(packageRemotePath, packageLocalPath)
    --- End diff --
    
    It's still there. Both messages `Fetch failed` and error message from `download.file` were there before.
    
    Before it is passing the url string several method calls deep, instead, I handle the error up in the stack and display the same message like in [here](https://github.com/apache/spark/pull/16589/files/9b21c1125998b09607dc40c57dcd579d322b6f6e#diff-48b5d60aba76122785461e1c2b125f51R121), and with url [here](https://github.com/apache/spark/pull/16589/files/9b21c1125998b09607dc40c57dcd579d322b6f6e#diff-48b5d60aba76122785461e1c2b125f51R176)



---
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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96277861
  
    --- Diff: R/pkg/R/install.R ---
    @@ -54,7 +54,7 @@
     #'                 }
     #' @param overwrite If \code{TRUE}, download and overwrite the existing tar file in localDir
     #'                  and force re-install Spark (in case the local directory or file is corrupted)
    -#' @return \code{install.spark} returns the local directory where Spark is found or installed
    +#' @return the (invisible) local directory where Spark is found or installed
    --- End diff --
    
    any reason to  change the return value here ?


---
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.
---

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


[GitHub] spark issue #16589: [SPARK-19231][SPARKR] add error handling for download an...

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

    https://github.com/apache/spark/pull/16589
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71409/
    Test 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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96289817
  
    --- Diff: R/pkg/R/install.R ---
    @@ -54,7 +54,7 @@
     #'                 }
     #' @param overwrite If \code{TRUE}, download and overwrite the existing tar file in localDir
     #'                  and force re-install Spark (in case the local directory or file is corrupted)
    -#' @return \code{install.spark} returns the local directory where Spark is found or installed
    +#' @return the (invisible) local directory where Spark is found or installed
    --- End diff --
    
    Got it. 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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

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


---
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.
---

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


[GitHub] spark issue #16589: [SPARK-19231][SPARKR] add error handling for download an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16589
  
    **[Test build #71409 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71409/testReport)** for PR 16589 at commit [`9b21c11`](https://github.com/apache/spark/commit/9b21c1125998b09607dc40c57dcd579d322b6f6e).


---
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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96284895
  
    --- Diff: R/pkg/R/install.R ---
    @@ -54,7 +54,7 @@
     #'                 }
     #' @param overwrite If \code{TRUE}, download and overwrite the existing tar file in localDir
     #'                  and force re-install Spark (in case the local directory or file is corrupted)
    -#' @return \code{install.spark} returns the local directory where Spark is found or installed
    +#' @return the (invisible) local directory where Spark is found or installed
    --- End diff --
    
    it wasn't actually - it was always invisible - see [here](https://github.com/apache/spark/pull/16589/files/9b21c1125998b09607dc40c57dcd579d322b6f6e#diff-48b5d60aba76122785461e1c2b125f51R150), just not documented as such. Also referencing the method name and saying `returns` again is redundant as this would go to the return section of the generated doc.



---
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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96569089
  
    --- Diff: R/pkg/R/install.R ---
    @@ -201,14 +221,20 @@ directDownloadTar <- function(mirrorUrl, version, hadoopVersion, packageName, pa
       msg <- sprintf(fmt, version, ifelse(hadoopVersion == "without", "Free build", hadoopVersion),
                      packageRemotePath)
       message(msg)
    -  downloadUrl(packageRemotePath, packageLocalPath, paste0("Fetch failed from ", mirrorUrl))
    +  downloadUrl(packageRemotePath, packageLocalPath)
    --- End diff --
    
    yea I agree. I guess I'm trying to bubble up error messages to the top level but generally the exception to throw is making this non-trivial (never thought I'd say that!)


---
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.
---

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


[GitHub] spark pull request #16589: [SPARK-19231][SPARKR] add error handling for down...

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

    https://github.com/apache/spark/pull/16589#discussion_r96278657
  
    --- Diff: R/pkg/R/install.R ---
    @@ -201,14 +221,20 @@ directDownloadTar <- function(mirrorUrl, version, hadoopVersion, packageName, pa
       msg <- sprintf(fmt, version, ifelse(hadoopVersion == "without", "Free build", hadoopVersion),
                      packageRemotePath)
       message(msg)
    -  downloadUrl(packageRemotePath, packageLocalPath, paste0("Fetch failed from ", mirrorUrl))
    +  downloadUrl(packageRemotePath, packageLocalPath)
    --- End diff --
    
    Any reason to not use this `Fetch failed from` error message and instead use the error message from `download.file`


---
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.
---

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


[GitHub] spark issue #16589: [SPARK-19231][SPARKR] add error handling for download an...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16589
  
    **[Test build #71409 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71409/testReport)** for PR 16589 at commit [`9b21c11`](https://github.com/apache/spark/commit/9b21c1125998b09607dc40c57dcd579d322b6f6e).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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.
---

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


[GitHub] spark issue #16589: [SPARK-19231][SPARKR] add error handling for download an...

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

    https://github.com/apache/spark/pull/16589
  
    Merged build finished. Test 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.
---

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


[GitHub] spark issue #16589: [SPARK-19231][SPARKR] add error handling for download an...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/spark/pull/16589
  
    merged to master and branch-2.1.
    @shivaram let me know if you have anything specific about this file re: your comment [here](https://github.com/apache/spark/pull/16589#pullrequestreview-16867309) you have in mind? I'll open a JIRA to track. 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.
---

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


[GitHub] spark issue #16589: [SPARK-19231][SPARKR] add error handling for download an...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the issue:

    https://github.com/apache/spark/pull/16589
  
    I think its fine to leave it as is now - When we next add some feature or update the file we can do some refactoring 


---
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.
---

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