Keep old names as part of the RenamingExecutor to debug big cached thread pools#493
Keep old names as part of the RenamingExecutor to debug big cached thread pools#493
Conversation
Generate changelog in
|
✅ Successfully generated changelog entry!What happened?Your changelog entries have been stored in the database as part of our migration to ChangelogV3. Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. |
pkoenig10
left a comment
There was a problem hiding this comment.
I don't think this is a good idea.
I don't think we should be leaking information about tasks after the task has completed.
And the information here isn't really useful. If the goal is to determine what executor caused a thread to be created, this doesn't tell you that, since the name will be replaced as soon as this thread is reused for another task. So, seeing a particular -was- name doesn't actually allow you make any reliable conclusions.
bjlaub
left a comment
There was a problem hiding this comment.
Approving for release candidate only.
[skip ci]
Invalidated by push of 3b3d13d
Before this PR
When using a NylonExecutor to wrap a cached threadpool with a name, when the task would finish, it would rename the thread back to the original name, usually something like
shared-1038. Many of our cached threadpools actually just share one big shared threadpool. When looking at JFRs or jstacks, it's common to see hundreds ofshared-18034threads which doesn't provide much info on what task caused the cached threadpool to accumulate threads after the task has finished. This is especially a problem if there is a large number of short-lived but concurrent tasks which cause the threadpool to expand, but doesn't leave a trace of what the task that caused the threadpool to expand so large.After this PR
Now, threads will be renamed to
shared-130483-was-tasknameafter the task has finished for observability and debugging. We limit to at most one-was-suffix to avoid accumulating more and more old task names in the thread names.Possible downsides?
I don't think there are any. The regex split is precompiled and should be fast