[CP] Give PX thread more better name

This commit is contained in:
obdev
2023-01-04 12:08:20 +00:00
committed by ob-robot
parent d8000e3816
commit cca9f7c2d2
2 changed files with 9 additions and 2 deletions

View File

@ -215,10 +215,17 @@ void ObPxPool::handle(ObLink *task)
ATOMIC_DEC(&concurrency_);
}
void ObPxPool::set_px_thread_name()
{
char buf[32];
snprintf(buf, 32, "PX_G%ld_%ld", group_id_, tenant_id_);
lib::set_thread_name_inner(buf);
}
void ObPxPool::run1()
{
int ret = OB_SUCCESS;
lib::set_thread_name("PxPoolTh", get_thread_idx());
set_px_thread_name();
auto *pm = common::ObPageManager::thread_local_instance();
if (OB_LIKELY(nullptr != pm)) {
pm->set_tenant_ctx(tenant_id_, common::ObCtxIds::WORK_AREA);

View File

@ -72,7 +72,7 @@ public:
void set_cgroup_ctrl(share::ObCgroupCtrl *cgroup_ctrl) { cgroup_ctrl_ = cgroup_ctrl; }
int64_t get_pool_size() const { return get_thread_count(); }
int submit(const RunFuncT &func);
void set_px_thread_name();
private:
void handle(common::ObLink *task);