-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Reduce the lock granularity of TaskWorkerPool #3571
Conversation
be/src/agent/task_worker_pool.h
Outdated
@@ -146,7 +146,7 @@ class TaskWorkerPool { | |||
static FrontendServiceClientCache _master_service_client_cache; | |||
static std::atomic_ulong _s_report_version; | |||
|
|||
static std::mutex _s_task_signatures_lock; | |||
static std::mutex _s_task_signatures_lock[TTaskType::type::TASK_TYPE_COUNT]; |
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.
we should manage and define a mutex for current active task types. TASK_TYPE_COUNT include may deprecated type.
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.
This only cause create more unused object, but I am not find an easy way to solve this problem.
I'm more afraid that this will be ignored when a new type is added later.
Co-authored-by: sduzh <[email protected]>
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.
The implementation is not thread-safe and the change in _report_task_worker_thread_callback
is incorrect.
What type of PR is this:
Which issues of this PR fixes :
Fixes #3539
Problem Summary(Required) :
_s_task_signatures_lock will lock all task of be.
When FE send lot of DROP task other type of task can not response to FE. will cause many strange problem.
there are many thread to submit_tasks
there are many thread to drop tablet
and one thread to report