-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-13747][SQL]Fix concurrent executions in ForkJoinPool for SQL #15520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'm not sure I completely understand why you have to use |
Yep. Without |
|
That makes sense, thanks for explaining. Would installing a custom |
|
Test build #67088 has finished for PR 15520 at commit
|
Yes, I think so. It just needs more lines :) |
|
retest this please |
I think the solution you propose is sound. Do you think that a quick mention about avoiding the |
|
Test build #67094 has finished for PR 15520 at commit
|
|
cc @andrewor14 |
|
Test build #67112 has finished for PR 15520 at commit
|
scalastyle-config.xml
Outdated
| // scalastyle:off awaitresult | ||
| Await.result(...) | ||
| // scalastyle:on awaitresult | ||
| If your codes use ThreadLocal and run in a user's thread, use ThreadUtils.awaitResultInForkJoinSafely instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the user's thread mean at here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant threads created by the user. Fixed the description.
|
Test build #67461 has finished for PR 15520 at commit
|
|
lgtm |
|
Thanks! Merging to master and 2.0. |
|
There are conflicts with 2.0. #15646 is the backport for 2.0. |
…(branch 2.0) ## What changes were proposed in this pull request? Backport #15520 to 2.0. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #15646 from zsxwing/SPARK-13747-2.0.
## What changes were proposed in this pull request? Calling `Await.result` will allow other tasks to be run on the same thread when using ForkJoinPool. However, SQL uses a `ThreadLocal` execution id to trace Spark jobs launched by a query, which doesn't work perfectly in ForkJoinPool. This PR just uses `Awaitable.result` instead to prevent ForkJoinPool from running other tasks in the current waiting thread. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#15520 from zsxwing/SPARK-13747.
## What changes were proposed in this pull request? Calling `Await.result` will allow other tasks to be run on the same thread when using ForkJoinPool. However, SQL uses a `ThreadLocal` execution id to trace Spark jobs launched by a query, which doesn't work perfectly in ForkJoinPool. This PR just uses `Awaitable.result` instead to prevent ForkJoinPool from running other tasks in the current waiting thread. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#15520 from zsxwing/SPARK-13747.
What changes were proposed in this pull request?
Calling
Await.resultwill allow other tasks to be run on the same thread when using ForkJoinPool. However, SQL uses aThreadLocalexecution id to trace Spark jobs launched by a query, which doesn't work perfectly in ForkJoinPool.This PR just uses
Awaitable.resultinstead to prevent ForkJoinPool from running other tasks in the current waiting thread.How was this patch tested?
Jenkins