You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by vanzin <gi...@git.apache.org> on 2017/08/07 23:11:18 UTC

[GitHub] spark pull request #18877: [SPARK-17742][core] Handle child process exit in ...

GitHub user vanzin opened a pull request:

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

    [SPARK-17742][core] Handle child process exit in SparkLauncher.

    Currently the launcher handle does not monitor the child spark-submit
    process it launches; this means that if the child exits with an error,
    the handle's state will never change, and an application will not know
    that the application has failed.
    
    This change adds code to monitor the child process, and changes the
    handle state appropriately when the child process exits.
    
    Tested with added unit tests.

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

    $ git pull https://github.com/vanzin/spark SPARK-17742

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

    https://github.com/apache/spark/pull/18877.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 #18877
    
----
commit 15e1a733dfea38ae09b92d88aeecd5a78de59408
Author: Marcelo Vanzin <va...@cloudera.com>
Date:   2017-08-07T22:30:16Z

    [SPARK-17742][core] Handle child process exit in SparkLauncher.
    
    Currently the launcher handle does not monitor the child spark-submit
    process it launches; this means that if the child exits with an error,
    the handle's state will never change, and an application will not know
    that the application has failed.
    
    This change adds code to monitor the child process, and changes the
    handle state appropriately when the child process exits.
    
    Tested with added unit tests.

----


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    yes @danelkotev `asfgit closed this in cba826d on Aug 15, 2017`


---

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


[GitHub] spark pull request #18877: [SPARK-17742][core] Handle child process exit in ...

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

    https://github.com/apache/spark/pull/18877#discussion_r132583520
  
    --- Diff: launcher/src/main/java/org/apache/spark/launcher/ChildProcAppHandle.java ---
    @@ -118,14 +116,40 @@ void setChildProc(Process childProc, String loggerName, InputStream logStream) {
         this.childProc = childProc;
         if (logStream != null) {
           this.redirector = new OutputRedirector(logStream, loggerName,
    -        SparkLauncher.REDIRECTOR_FACTORY);
    +        SparkLauncher.REDIRECTOR_FACTORY, this);
    +    } else {
    +      // If there is no log redirection, spawn a thread that will wait for the child process
    +      // to finish.
    +      Thread waiter = SparkLauncher.REDIRECTOR_FACTORY.newThread(this::monitorChild);
    +      waiter.setDaemon(true);
    +      waiter.start();
         }
       }
     
       void setConnection(LauncherConnection connection) {
         this.connection = connection;
       }
     
    +  /**
    +   * Callback for when the child process exits. Forcefully put the application in a final state,
    +   * overwriting the current final state unless it is already FAILED.
    +   */
    +  synchronized void childProcessExited() {
    +    disconnect();
    +
    +    int ec;
    +    try {
    +      ec = childProc.exitValue();
    +    } catch (Exception e) {
    --- End diff --
    
    might want to log the exception 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 pull request #18877: [SPARK-17742][core] Handle child process exit in ...

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

    https://github.com/apache/spark/pull/18877#discussion_r132583553
  
    --- Diff: launcher/src/main/java/org/apache/spark/launcher/ChildProcAppHandle.java ---
    @@ -166,4 +185,15 @@ private synchronized void fireEvent(boolean isInfoChanged) {
         }
       }
     
    +  private void monitorChild() {
    +    while (childProc.isAlive()) {
    +      try {
    +        childProc.waitFor();
    +      } catch (Exception e) {
    +        // Try again.
    --- End diff --
    
    log exception 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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    @vanzin @SparkQA 
    Hi, Is this fix was merged into master?


---

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


[GitHub] spark issue #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    **[Test build #80511 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/80511/testReport)** for PR 18877 at commit [`def2329`](https://github.com/apache/spark/commit/def23297b4c3b1542696e5fd2f7efb6aca9274c1).
     * 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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    **[Test build #80511 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/80511/testReport)** for PR 18877 at commit [`def2329`](https://github.com/apache/spark/commit/def23297b4c3b1542696e5fd2f7efb6aca9274c1).


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    Alright, merging this to master.


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    **[Test build #80368 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/80368/testReport)** for PR 18877 at commit [`15e1a73`](https://github.com/apache/spark/commit/15e1a733dfea38ae09b92d88aeecd5a78de59408).


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    If there's no more feedback, I plan to push this soon to unblock other work on this module.


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    trying to get some reviews: @srowen @zsxwing 


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    **[Test build #80368 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/80368/testReport)** for PR 18877 at commit [`15e1a73`](https://github.com/apache/spark/commit/15e1a733dfea38ae09b92d88aeecd5a78de59408).
     * 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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    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 pull request #18877: [SPARK-17742][core] Handle child process exit in ...

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

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


---
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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

    https://github.com/apache/spark/pull/18877
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/80511/
    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 #18877: [SPARK-17742][core] Handle child process exit in SparkLa...

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

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