forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#19090] Fix a memory leak in tracked outbound calls in Reactor
Summary: Fix a memory leak in tracked_outbound_calls_ in Reactor by cleaning up that data structure more aggressively: - When traversing tracked calls in the order of increasing next check time, even if it already greater than the current time, stay in the loop and continue removing entries where the callback has been called or the weak pointer has expired. - When a callback is invoked, notify the reactor through a multi-producer single-consumer queue that is accessed from the OutboundCall via a weak pointer. Also remove the FinalizeTrackedCall function that was likely useless because it was called concurrently with the callback being handled by the thread pool. In addition, we are switching OutboundCall allocation away from using make_shared to prevent long-lived weak OutboundCall pointers from consuming memory. Test Plan: Jenkins Local sysbench testing: ``` ./yb_build.sh release --no-tests --skip-java bin/yb-ctl wipe_restart --tserver_flag="memory_limit_hard_bytes=$(( 4 * 1024 * 1024 * 1024 ))" bin/yb-ctl add_node bin/yb-ctl add_node ``` Verify we have 3 nodes: ``` bin/yb-ctl status ``` Run sysbench with a table size of 1000000 using a modified version of the run_sysbench.sh script ( https://gist.githubusercontent.com/mbautin/6f0d441b28479232bd2af9b434bed242/raw ) ``` ./run_sysbench.sh --tablesize 1000000 ``` Wait until the run completes. Check the logs for errors (there should be none): ``` find ~/yugabyte-data -name "yb-tserver.INFO" -exec grep -E "Stuck|large number" {} \; ``` Reviewers: sergei Reviewed By: sergei Subscribers: yql, ybase Differential Revision: https://phorge.dev.yugabyte.com/D28531
- Loading branch information
Showing
7 changed files
with
139 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.