-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](memory) fix ThreadPoolExecutor leak in PublishVersionDaemon #60720
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
base: master
Are you sure you want to change the base?
Conversation
`publishExecutors` is a static field, but the constructor appends new thread pools on every invocation without checking if they already exist. The constructor is called each time a new Env instance is created, which happens periodically during Env checkpoint/journal replay (the checkpoint thread creates a new Env to replay the journal). Each call appends `publish_thread_pool_num` (default 128) pools to the static list, causing unbounded growth. Heap dump analysis (branch-4.0, 12 rounds of p0 regression) confirmed: - ThreadPoolExecutor: R1: 2,506 → R12: 12,236 (+388.3%), 11/11 strictly increasing - dbExecutors backing array grew to Object[11070] (~86 Env replays × 128 pools) - Each leaked pool retains threads, locks, and condition queues Fix: skip pool creation if publishExecutors is already populated.
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
What problem does this PR solve?
publishExecutors is a static field, but the constructor appends new thread pools on every invocation without checking if they already exist.
The constructor is called each time a new Env instance is created, which happens periodically during Env checkpoint/journal replay (the checkpoint thread creates a new Env to replay the journal). Each call appends publish_thread_pool_num (default 128) pools to the static list, causing unbounded growth.
Heap dump analysis (branch-4.0, 12 rounds of p0 regression) confirmed:
ThreadPoolExecutor: R1: 2,506 → R12: 12,236 (+388.3%), 11/11 strictly increasing
dbExecutors backing array grew to Object[11070] (~86 Env replays × 128 pools)
Each leaked pool retains threads, locks, and condition queues
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)