You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by dongjoon-hyun <gi...@git.apache.org> on 2016/06/13 05:58:24 UTC

[GitHub] spark pull request #13634: [SPARK-15913][CORE] Dispatcher.stopped should be ...

GitHub user dongjoon-hyun opened a pull request:

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

    [SPARK-15913][CORE] Dispatcher.stopped should be enclosed by synchronized block.

    ## What changes were proposed in this pull request?
    
    `Dispatcher.stopped` is guarded by `this`, but it is used without synchronization in `postMessage` function. This PR fixes this and also the exception message became more accurate.
    
    ## How was this patch tested?
    
    Pass the existing Jenkins tests.

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

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-15913

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

    https://github.com/apache/spark/pull/13634.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 #13634
    
----
commit 75a5254371374faf66f166e1b2683d3f9803cb8e
Author: Dongjoon Hyun <do...@apache.org>
Date:   2016-06-13T05:53:47Z

    [SPARK-15913][CORE] Dispatcher.stopped should be enclosed by synchronized block.

----


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be ...

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

    https://github.com/apache/spark/pull/13634#discussion_r66757678
  
    --- Diff: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala ---
    @@ -144,24 +144,21 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv) extends Logging {
           endpointName: String,
           message: InboxMessage,
           callbackIfStopped: (Exception) => Unit): Unit = {
    -    val shouldCallOnStop = synchronized {
    +    val error: Option[Exception] = synchronized {
           val data = endpoints.get(endpointName)
    -      if (stopped || data == null) {
    -        true
    +      if (stopped) {
    +        Some(new RpcEnvStoppedException())
    +      } else if (data == null) {
    +        Some(new SparkException(s"Could not find $endpointName."))
           } else {
             data.inbox.post(message)
             receivers.offer(data)
    -        false
    +        None
           }
         }
    -    if (shouldCallOnStop) {
    +    if (error.isDefined) {
    --- End diff --
    
    This could be `error.foreach(callbackIfStopped)`. You don't need the `Option` type above I think, but up to your judgment about readability.


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be ...

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

    https://github.com/apache/spark/pull/13634#discussion_r66761760
  
    --- Diff: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala ---
    @@ -144,24 +144,21 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv) extends Logging {
           endpointName: String,
           message: InboxMessage,
           callbackIfStopped: (Exception) => Unit): Unit = {
    -    val shouldCallOnStop = synchronized {
    +    val error: Option[Exception] = synchronized {
           val data = endpoints.get(endpointName)
    -      if (stopped || data == null) {
    -        true
    +      if (stopped) {
    +        Some(new RpcEnvStoppedException())
    +      } else if (data == null) {
    +        Some(new SparkException(s"Could not find $endpointName."))
           } else {
             data.inbox.post(message)
             receivers.offer(data)
    -        false
    +        None
           }
         }
    -    if (shouldCallOnStop) {
    +    if (error.isDefined) {
    --- End diff --
    
    Thank you again. I'll change both, too.


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be ...

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

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


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    **[Test build #60394 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60394/consoleFull)** for PR 13634 at commit [`b9e90a8`](https://github.com/apache/spark/commit/b9e90a8d1a598954e9ca6f3b48702b5e67d41565).


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    **[Test build #60394 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60394/consoleFull)** for PR 13634 at commit [`b9e90a8`](https://github.com/apache/spark/commit/b9e90a8d1a598954e9ca6f3b48702b5e67d41565).
     * 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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    **[Test build #60397 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60397/consoleFull)** for PR 13634 at commit [`2446b37`](https://github.com/apache/spark/commit/2446b37bcea24c708fb9575614bf537799ca7d50).


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60383/
    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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Thank you for review, @srowen .
    Oh, right. That sounds much better to me.
    I'll update this PR like 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 issue #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    **[Test build #60383 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60383/consoleFull)** for PR 13634 at commit [`75a5254`](https://github.com/apache/spark/commit/75a5254371374faf66f166e1b2683d3f9803cb8e).
     * 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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Hi, @vanzin .
    Could you review this when you have some time?


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Do you need the flag anymore? Maybe return an Option with the error instead


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60394/
    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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60397/
    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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    **[Test build #60397 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60397/consoleFull)** for PR 13634 at commit [`2446b37`](https://github.com/apache/spark/commit/2446b37bcea24c708fb9575614bf537799ca7d50).
     * 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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    LGTM. Merging to master / 2.0.


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Thank you, @vanzin !


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    Thank you always, @srowen .


---
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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    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 #13634: [SPARK-15913][CORE] Dispatcher.stopped should be enclose...

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

    https://github.com/apache/spark/pull/13634
  
    **[Test build #60383 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60383/consoleFull)** for PR 13634 at commit [`75a5254`](https://github.com/apache/spark/commit/75a5254371374faf66f166e1b2683d3f9803cb8e).


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