You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zsxwing <gi...@git.apache.org> on 2015/03/31 05:31:37 UTC
[GitHub] spark pull request: [SPARK-6621][Core] Fix the bug that calling Ev...
GitHub user zsxwing opened a pull request:
https://github.com/apache/spark/pull/5280
[SPARK-6621][Core] Fix the bug that calling EventLoop.stop in EventLoop.onReceive/onError/onStart doesn't call onStop
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zsxwing/spark SPARK-6621
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5280.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 #5280
----
commit 521125e825bd4919c0a36c1092aaf789a42539bb
Author: zsxwing <zs...@gmail.com>
Date: 2015-03-31T03:29:12Z
Fix the bug that calling EventLoop.stop in EventLoop.onReceive and EventLoop.onError doesn't call onStop
----
---
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-6621][Core] Fix the bug that calling Ev...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/5280
---
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-6621][Core] Fix the bug that calling Ev...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5280#issuecomment-87921859
[Test build #29442 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29442/consoleFull) for PR 5280 at commit [`521125e`](https://github.com/apache/spark/commit/521125e825bd4919c0a36c1092aaf789a42539bb).
---
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-6621][Core] Fix the bug that calling Ev...
Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/5280#issuecomment-89177379
LGTM, so I'm going to merge this into `master` (1.4.0) and `branch-1.3` (1.3.1). 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: [SPARK-6621][Core] Fix the bug that calling Ev...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5280#issuecomment-87938423
[Test build #29442 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29442/consoleFull) for PR 5280 at commit [`521125e`](https://github.com/apache/spark/commit/521125e825bd4919c0a36c1092aaf789a42539bb).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds the following public classes _(experimental)_:
* `class UDFRegistration(object):`
* This patch does not change any dependencies.
---
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-6621][Core] Fix the bug that calling Ev...
Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/5280#discussion_r27452652
--- Diff: core/src/main/scala/org/apache/spark/util/EventLoop.scala ---
@@ -76,9 +76,21 @@ private[spark] abstract class EventLoop[E](name: String) extends Logging {
def stop(): Unit = {
if (stopped.compareAndSet(false, true)) {
eventThread.interrupt()
- eventThread.join()
- // Call onStop after the event thread exits to make sure onReceive happens before onStop
- onStop()
+ var onStopCalled = false
+ try {
+ eventThread.join()
+ // Call onStop after the event thread exits to make sure onReceive happens before onStop
+ onStopCalled = true
+ onStop()
+ } catch {
+ case ie: InterruptedException =>
+ Thread.currentThread().interrupt()
+ if (!onStopCalled) {
+ // ie is thrown from `eventThread.join()`. Otherwise, we should not call `onStop` since
--- End diff --
In the uint tests added here, when does `join()` throw `InterruptedException`?
---
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-6621][Core] Fix the bug that calling Ev...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/5280#issuecomment-89158963
@JoshRosen does this look good?
---
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-6621][Core] Fix the bug that calling Ev...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5280#issuecomment-87938429
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29442/
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: [SPARK-6621][Core] Fix the bug that calling Ev...
Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/5280#discussion_r27453086
--- Diff: core/src/main/scala/org/apache/spark/util/EventLoop.scala ---
@@ -76,9 +76,21 @@ private[spark] abstract class EventLoop[E](name: String) extends Logging {
def stop(): Unit = {
if (stopped.compareAndSet(false, true)) {
eventThread.interrupt()
- eventThread.join()
- // Call onStop after the event thread exits to make sure onReceive happens before onStop
- onStop()
+ var onStopCalled = false
+ try {
+ eventThread.join()
+ // Call onStop after the event thread exits to make sure onReceive happens before onStop
+ onStopCalled = true
+ onStop()
+ } catch {
+ case ie: InterruptedException =>
+ Thread.currentThread().interrupt()
+ if (!onStopCalled) {
+ // ie is thrown from `eventThread.join()`. Otherwise, we should not call `onStop` since
--- End diff --
If the current thread is eventThread, then eventThread.interrupt() set the interrupt flag. So `join` will throw `InterruptedException`.
---
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