-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-11126][SQL]Fix a memory leak in SQLListener._stageIdToStageMetrics #9132
Conversation
Test build #43769 has finished for PR 9132 at commit
|
retest this please |
Test build #43773 has finished for PR 9132 at commit
|
looks good, can you add a test? |
} else { | ||
// If a stage belongs to some SQL execution, its stageId will be put in "onJobStart". | ||
// Since "_stageIdToStageMetrics" doesn't contain it, it must not belong to any SQL execution. | ||
// So we can ignore it. |
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.
in which case we will have such a stage ID that doesn't belong to any SQL execution?
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.
E.g., use SQLContext in a Streaming application.
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.
can you add "Otherwise, this may lead to memory leaks (SPARK-11126)"
|
||
class SQLListenerMemoryLeakSuite extends SparkFunSuite { | ||
|
||
test("no memory leak") { |
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 moved this test to SQLListenerMemoryLeakSuite
and enabled it because it needs to create a new SparkContext.
Test build #43828 has finished for PR 9132 at commit
|
LGTM, would be good to backport into 1.5. |
This PR doesn't have conflicts with branch 1.5. |
Test build #43879 has finished for PR 9132 at commit
|
LGTM as well, so I'm going to merge this into master and branch-1.5. Thanks! |
…trics SQLListener adds all stage infos to `_stageIdToStageMetrics`, but only removes stage infos belonging to SQL executions. This PR fixed it by ignoring stages that don't belong to SQL executions. Reported by Terry Hoo in https://www.mail-archive.com/userspark.apache.org/msg38810.html Author: zsxwing <zsxwing@gmail.com> Closes #9132 from zsxwing/SPARK-11126. (cherry picked from commit 94c8fef) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
The unit test added in #9132 is flaky. This is a follow up PR to add `listenerBus.waitUntilEmpty` to fix it. Author: zsxwing <zsxwing@gmail.com> Closes #9163 from zsxwing/SPARK-11126-follow-up.
The unit test added in #9132 is flaky. This is a follow up PR to add `listenerBus.waitUntilEmpty` to fix it. Author: zsxwing <zsxwing@gmail.com> Closes #9163 from zsxwing/SPARK-11126-follow-up. (cherry picked from commit beb8bc1) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
SQLListener adds all stage infos to
_stageIdToStageMetrics
, but only removes stage infos belonging to SQL executions. This PR fixed it by ignoring stages that don't belong to SQL executions.Reported by Terry Hoo in https://www.mail-archive.com/user@spark.apache.org/msg38810.html