-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix threadpool blocked when create thread failed in init() #46366
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
50674ee
to
afc37a7
Compare
run buildall |
afc37a7
to
177a52f
Compare
run buildall |
TPC-H: Total hot run time: 32534 ms
|
TPC-DS: Total hot run time: 189849 ms
|
ClickBench: Total hot run time: 31.93 s
|
TeamCity be ut coverage result: |
run buildall |
TPC-H: Total hot run time: 32784 ms
|
TPC-DS: Total hot run time: 197363 ms
|
TeamCity be ut coverage result: |
ClickBench: Total hot run time: 31.1 s
|
be/src/util/threadpool.cpp
Outdated
@@ -273,19 +273,32 @@ ThreadPool::~ThreadPool() { | |||
shutdown(); | |||
} | |||
|
|||
Status ThreadPool::try_create_thread(int thread_num) { |
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.
参数里加一个lock
run buildall |
2e05d6b
to
1b6a4ec
Compare
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 32747 ms
|
TPC-DS: Total hot run time: 190610 ms
|
ClickBench: Total hot run time: 30.8 s
|
TeamCity be ut coverage result: |
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.
LGTM
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Threadpool's
_num_threads_pending_start
field means a thread is created successfully, but has not begin executing, it increments when create thread succ, and then decrements when the thread begin runs.Currently
init
andset_min/max_threads
method create threads and increment_num_threads_pending_start
, but not decrement it if some threads create failed.This means
_num_threads_pending_start
can not be zero even all threads finish, then calling threadpool.shutdown could be blocked.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)