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

Set thread title #2574

Merged
merged 3 commits into from
Aug 20, 2019
Merged

Set thread title #2574

merged 3 commits into from
Aug 20, 2019

Conversation

jkohen
Copy link
Contributor

@jkohen jkohen commented Aug 16, 2019

This helps understand thread usage with commands like top -H and ps -e -T

Before this change the thread name shows up as thread.rb:70. After, it may show up as whatever title was given. The exact behavior will depend on the implementation of Ruby's native_set_another_thread_name.

This helps understand thread usage with commands like `top -H` and `ps -e -T`

Signed-off-by: Javier Kohen <jkohen@google.com>
Signed-off-by: Javier Kohen <jkohen@google.com>
@jkohen
Copy link
Contributor Author

jkohen commented Aug 16, 2019

It looks like the Thread.name= method was introduced in Ruby 2.3.0, hence the build failures. Any suggestions on how to get that to work? We are investigating what is causing a high number of threads in fluentd, which affects the memory usage in GKE.

FWIW, Ruby 2.3.8 is already EOL and Travis doesn't seem to be testing against 2.3.x. When are you planning to stop supporting 2.1.10?

@repeatedly
Copy link
Member

Any suggestions on how to get that to work?

How about thread.name = title.to_s if thread.respond_to?(:name) ?

Signed-off-by: Javier Kohen <jkohen@google.com>
@jkohen
Copy link
Contributor Author

jkohen commented Aug 19, 2019

Any suggestions on how to get that to work?

How about thread.name = title.to_s if thread.respond_to?(:name) ?

Cool, that seems to have worked! Thanks, I'm all new to Ruby.

@ganmacs ganmacs merged commit 2df5ed1 into fluent:master Aug 20, 2019
@ganmacs
Copy link
Member

ganmacs commented Aug 20, 2019

Thanks!

@jkohen jkohen deleted the patch-1 branch August 21, 2019 13:09
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.

3 participants