diff options
author | Josh Rosen <joshrosen@databricks.com> | 2014-11-16 00:44:15 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2014-11-16 00:44:15 -0800 |
commit | 7850e0c707affd5eafd570fb43716753396cf479 (patch) | |
tree | 100aa5c6368cd63bb896e36f3bfca5ed5e29279b /sql/hive-thriftserver | |
parent | 84468b2e2031d646dcf035cb18947170ba326ccd (diff) | |
download | spark-7850e0c707affd5eafd570fb43716753396cf479.tar.gz spark-7850e0c707affd5eafd570fb43716753396cf479.tar.bz2 spark-7850e0c707affd5eafd570fb43716753396cf479.zip |
[SPARK-4393] Fix memory leak in ConnectionManager ACK timeout TimerTasks; use HashedWheelTimer
This patch is intended to fix a subtle memory leak in ConnectionManager's ACK timeout TimerTasks: in the old code, each TimerTask held a reference to the message being sent and a cancelled TimerTask won't necessarily be garbage-collected until it's scheduled to run, so this caused huge buildups of messages that weren't garbage collected until their timeouts expired, leading to OOMs.
This patch addresses this problem by capturing only the message ID in the TimerTask instead of the whole message, and by keeping a WeakReference to the promise in the TimerTask. I've also modified this code to use Netty's HashedWheelTimer, whose performance characteristics should be better for this use-case.
Thanks to cristianopris for narrowing down this issue!
Author: Josh Rosen <joshrosen@databricks.com>
Closes #3259 from JoshRosen/connection-manager-timeout-bugfix and squashes the following commits:
afcc8d6 [Josh Rosen] Address rxin's review feedback.
2a2e92d [Josh Rosen] Keep only WeakReference to promise in TimerTask;
0f0913b [Josh Rosen] Spelling fix: timout => timeout
3200c33 [Josh Rosen] Use Netty HashedWheelTimer
f847dd4 [Josh Rosen] Don't capture entire message in ACK timeout task.
Diffstat (limited to 'sql/hive-thriftserver')
0 files changed, 0 insertions, 0 deletions