Skip to content
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

naming timer sampling and worker threads #2136

Merged
merged 3 commits into from
Feb 27, 2023
Merged

Conversation

ehds
Copy link
Contributor

@ehds ehds commented Feb 24, 2023

What problem does this PR solve?

Issue Number: #1923

Problem Summary: Naming threads for debugging.

线程命名方式: brpc 开头 + 线程用途
其中 worker 线程以 id 作为区分。

What is changed and the side effects?

No
Changed:
Naming sampling, timer and worker threads.
Side effects:

  • Performance effects(性能影响):
    No
  • Breaking backward compatibility(向后兼容性):
    No

Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@@ -108,6 +109,7 @@ class SamplerCollector : public bvar::Reducer<Sampler*, CombineSampler> {
void run();

static void* sampling_thread(void* arg) {
butil::PlatformThread::SetName("brpc_sampling");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the sampling thread, bvar also has a grab thread and two dump threads. (see variable.cpp and collector.cpp) Can you also add names to them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@chenBright
Copy link
Contributor

chenBright commented Feb 25, 2023

if (pthread_create(&th, NULL, UserCodeRunner, this) != 0) {
LOG(ERROR) << "Fail to create UserCodeRunner";
return -1;
}

Can you also add name to UserCodeBackupPool?

@ehds
Copy link
Contributor Author

ehds commented Feb 25, 2023

if (pthread_create(&th, NULL, UserCodeRunner, this) != 0) {
LOG(ERROR) << "Fail to create UserCodeRunner";
return -1;
}

Can you also add name to UserCodeBackupPool?

done

@wwbmmm
Copy link
Contributor

wwbmmm commented Feb 27, 2023

LGTM

@zyearn zyearn merged commit ef46998 into apache:master Feb 27, 2023
yanglimingcn pushed a commit to yanglimingcn/brpc that referenced this pull request Jun 25, 2023
* naming timer sampling and worker threads

* naming colloctor and varaiable

* naming usercode backup thread

---------

Co-authored-by: DongSheng He <hds@dipeak.com>
yanglimingcn pushed a commit to yanglimingcn/brpc that referenced this pull request Oct 31, 2023
* naming timer sampling and worker threads

* naming colloctor and varaiable

* naming usercode backup thread

---------

Co-authored-by: DongSheng He <hds@dipeak.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants