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

[GitHub] spark pull request: Update StreamingContext.scala [SPARK-11137]

GitHub user jayadevanmurali opened a pull request:

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

     Update StreamingContext.scala [SPARK-11137]

    Make StreamingContext.stop() exception-safe

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

    $ git pull https://github.com/jayadevanmurali/spark branch-0.1-SPARK-11137

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

    https://github.com/apache/spark/pull/10807.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 #10807
    
----
commit 39bcfb58b2e0e63afcdd931f881d6071e246d4c2
Author: jayadevanmurali <ja...@tcs.com>
Date:   2016-01-18T16:20:56Z

     Update StreamingContext.scala [SPARK-11137]
    
    Make StreamingContext.stop() exception-safe

----


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#discussion_r50090823
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala ---
    @@ -714,12 +714,20 @@ class StreamingContext private[streaming] (
               // interrupted. See SPARK-12001 for more details. Because the body of this case can be
               // executed twice in the case of a partial stop, all methods called here need to be
               // idempotent.
    -          scheduler.stop(stopGracefully)
    --- End diff --
    
    My interpretation of the purpose was a little different. If cleanup involves running A, B and C, then we want B and C to try to run even if A fails. I didn't think we necessarily expected the caller to re-try `stop()` since I don't think that's usual. Yes, a fatal error will still cause the whole thing to stop but in my mind a fatal error means lots of bets are off. This is also for consistency with how `SparkContext.stop()` works.


---
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: Update StreamingContext.scala [SPARK-11137]

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

    https://github.com/apache/spark/pull/10807#issuecomment-172604287
  
    @jayadevanmurali provide a better title/description please. "Update" doesn't say what this is about. It matters since it becomes the commit message


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

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


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-172609322
  
    @srowen sure and updated the the title 


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-173769284
  
    @srowen it's good - I agree asking the caller to retry stop() or even put it in a loop is too far off. It might happen when someone is running from spark-shell or similar but likely it's an edge case.
    Try to run as much as we could at stop() seems fair.


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-172646608
  
    LGTM


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#discussion_r50073547
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala ---
    @@ -714,12 +714,20 @@ class StreamingContext private[streaming] (
               // interrupted. See SPARK-12001 for more details. Because the body of this case can be
               // executed twice in the case of a partial stop, all methods called here need to be
               // idempotent.
    -          scheduler.stop(stopGracefully)
    --- End diff --
    
    I think one of the primary goal of this JIRA is to allow partial clean-up and retry on `stop()` calls.
    
    In this specific code path, it is already written in a way to allow for retry by setting the state to `STOPPED` only almost at the end on [line 728](https://github.com/apache/spark/pull/10807/files#diff-8a7f0e3f26c15ba484e6312c3caf033dL728) in the original code. 
    
    `tryLogNonFatalError` swallows and logs "non-fatal" exception, and with that added, despite any non-critical error thrown it could reach the line `state = STOPPED`. For instance, if `env.metricsSystem.removeSource()` throws then it will continue on and setting `state` to `STOPPED`, at which point the caller cannot get back to the same code to retry cleanup because of the `state` match case [above](https://github.com/apache/spark/pull/10807/files#diff-8a7f0e3f26c15ba484e6312c3caf033dR707).
    
    Is that what we want?


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-173609582
  
    @felixcheung WDYT?


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-174176986
  
    Merged 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 pull request: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-173808337
  
    This fix would be executed in similar consistent way it has been fixed in SparkContext.stop() .I think this is fine.


---
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: Update StreamingContext.scala [SPARK-11137]

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

    https://github.com/apache/spark/pull/10807#issuecomment-172592994
  
    Can one of the admins verify this patch?


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-172647001
  
    **[Test build #2399 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2399/consoleFull)** for PR 10807 at commit [`39bcfb5`](https://github.com/apache/spark/commit/39bcfb58b2e0e63afcdd931f881d6071e246d4c2).


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-173197159
  
    @srowen Thanks for the detailed comment. Can you merge the changes to master branch


---
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: [SPARK-11137][Streaming] Make StreamingContext...

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

    https://github.com/apache/spark/pull/10807#issuecomment-172660029
  
    **[Test build #2399 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2399/consoleFull)** for PR 10807 at commit [`39bcfb5`](https://github.com/apache/spark/commit/39bcfb58b2e0e63afcdd931f881d6071e246d4c2).
     * 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 pull request: Update StreamingContext.scala [SPARK-11137]

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

    https://github.com/apache/spark/pull/10807#issuecomment-172595828
  
    Exceptions are handled for each of the operations in the stop method, so that any exceptions does not abort rest of the statements


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