-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-19481][REPL][maven]Avoid to leak SparkContext in Signaling.cancelOnInterrupt #16825
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
|
Test build #72472 has finished for PR 16825 at commit
|
|
cc @davies |
|
This PR doesn't fix all leaks though. I noticed that there are many Finalizers and it slows down GC. Most of them are |
| } else { | ||
| false | ||
| } | ||
| def cancelOnInterrupt(): Unit = SignalUtils.register("INT") { |
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.
Who is using this one? Is this a breaking change?
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.
It's used by REPL to cancel the running job if any.
|
lgtm, merging this into master and 2.1 branch, thanks |
…cancelOnInterrupt ## What changes were proposed in this pull request? `Signaling.cancelOnInterrupt` leaks a SparkContext per call and it makes ReplSuite unstable. This PR adds `SparkContext.getActive` to allow `Signaling.cancelOnInterrupt` to get the active `SparkContext` to avoid the leak. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #16825 from zsxwing/SPARK-19481. (cherry picked from commit 303f00a) Signed-off-by: Davies Liu <[email protected]>
…cancelOnInterrupt ## What changes were proposed in this pull request? `Signaling.cancelOnInterrupt` leaks a SparkContext per call and it makes ReplSuite unstable. This PR adds `SparkContext.getActive` to allow `Signaling.cancelOnInterrupt` to get the active `SparkContext` to avoid the leak. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes apache#16825 from zsxwing/SPARK-19481.
…cancelOnInterrupt ## What changes were proposed in this pull request? `Signaling.cancelOnInterrupt` leaks a SparkContext per call and it makes ReplSuite unstable. This PR adds `SparkContext.getActive` to allow `Signaling.cancelOnInterrupt` to get the active `SparkContext` to avoid the leak. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #16825 from zsxwing/SPARK-19481.
|
Also cherry-picked to branch 2.0 as I saw ReplSuite failed several times on branch-2.0. |
What changes were proposed in this pull request?
Signaling.cancelOnInterruptleaks a SparkContext per call and it makes ReplSuite unstable.This PR adds
SparkContext.getActiveto allowSignaling.cancelOnInterruptto get the activeSparkContextto avoid the leak.How was this patch tested?
Jenkins