Skip to content
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-25266][CORE] Fix memory leak in Barrier Execution Mode #22258

Closed
wants to merge 1 commit into from

Conversation

sarutak
Copy link
Member

@sarutak sarutak commented Aug 28, 2018

What changes were proposed in this pull request?

BarrierCoordinator uses Timer and TimerTask. TimerTask#cancel() is invoked in ContextBarrierState#cancelTimerTask but Timer#purge() is never invoked.

Once a TimerTask is scheduled, the reference to it is not released until Timer#purge() is invoked even though TimerTask#cancel() is invoked.

How was this patch tested?

I checked the number of instances related to the TimerTask using jmap.

@rxin
Copy link
Contributor

rxin commented Aug 28, 2018

Can you remove vulnerability from the title? Otherwise it sounds like a security vulnerability here.

@SparkQA
Copy link

SparkQA commented Aug 28, 2018

Test build #95372 has finished for PR 22258 at commit 1503974.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@sarutak sarutak changed the title [SPARK-25266] Fix memory leak vulnerability in Barrier Execution Mode [SPARK-25266] Fix memory leak issue in Barrier Execution Mode Aug 29, 2018
@sarutak sarutak changed the title [SPARK-25266] Fix memory leak issue in Barrier Execution Mode [SPARK-25266] Fix memory leak in Barrier Execution Mode Aug 29, 2018
@sarutak
Copy link
Member Author

sarutak commented Aug 29, 2018

All right. It's done.

@sarutak sarutak changed the title [SPARK-25266] Fix memory leak in Barrier Execution Mode [SPARK-25266][CORE] Fix memory leak in Barrier Execution Mode Aug 29, 2018
@sarutak
Copy link
Member Author

sarutak commented Aug 29, 2018

retest this please.

@mengxr
Copy link
Contributor

mengxr commented Aug 29, 2018

LGTM pending test

@SparkQA
Copy link

SparkQA commented Aug 29, 2018

Test build #95396 has finished for PR 22258 at commit 1503974.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@mengxr
Copy link
Contributor

mengxr commented Aug 29, 2018

Merged into master. Thanks!

@asfgit asfgit closed this in 3864480 Aug 29, 2018
fjh100456 pushed a commit to fjh100456/spark that referenced this pull request Aug 31, 2018
## What changes were proposed in this pull request?

BarrierCoordinator uses Timer and TimerTask. `TimerTask#cancel()` is invoked in ContextBarrierState#cancelTimerTask but `Timer#purge()` is never invoked.

Once a TimerTask is scheduled, the reference to it is not released until `Timer#purge()` is invoked even though `TimerTask#cancel()` is invoked.

## How was this patch tested?

I checked the number of instances related to the TimerTask using jmap.

Closes apache#22258 from sarutak/fix-barrierexec-oom.

Authored-by: sarutak <sarutak@oss.nttdata.co.jp>
Signed-off-by: Xiangrui Meng <meng@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants