-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Identify system threads using a Thread subclass #113562
Identify system threads using a Thread subclass #113562
Conversation
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
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.
I like this. I think core-infra should also be ok with it. It would be good however if we could pass the isSystem
value via a boolean. Not just for aesthetic reasons, but as mentioned I think there's other things we can do with subclassing Thread
here and it would be nice to start in a clean way :)
this.namePrefix = namePrefix; | ||
SecurityManager s = System.getSecurityManager(); | ||
group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); | ||
isSystem = executorName != null && SYSTEM_THREAD_PREFIXES.contains(executorName); |
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.
I know I did this too in my prototype, but you have to admit it's a little lame? Think we could maybe pass the isSystem
property through the steps of building the executor via a boolean flag?
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.
Makes sense - removed dependency on naming in 71a0d28
@elasticmachine update branch |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
Looks ok to me
💔 Backport failedThe backport operation could not be completed due to the following error:
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
(cherry picked from commit bbd887a)
Part of the work in #113194
Identifies system threads by using a dedicated
Thread
subclass,EsThread
.EsExecutor
includes aisSystem
attribute that gets populated on creation according to the executor name. This attribute is used to flag the threads the executor creates.A
isSystem
attribute in theEsThread
class can be checked for understanding if a thread is a system thread.