Tab 'Threads' doesn't refresh thread names and thread renamings.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.3k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
In threads list in tab 'Threads' threads that have been renamed do not change their names after they had been initially displayed in list.
To Reproduce
Steps to reproduce the behavior:
- Write simple application with main(args) method
- Start some thread pool with named thread factory setting some %yourPrefix% for thread names and run some tasks to populate pool with threads.
- Open VisualVM and go to tab 'threads'. Threads named with the prefix provided in thread factory in step 3 are present in list .
- do following thing with your executor:
executor.execute(() -> Thread.currentThread().setName(%anotherName%)); - Return to VisualVM threads list. Name change %yourPrefix% -> %anotherName% would not be displayed in list. As a matter of fact, thread renaming is done, but VisualVM have not refreshed the list. In order to see renaming result, close this particular JVM tab and open it again - new thread name is visible.
Expected behavior
It is expected that thread renaming effect will be displayed in threads list after Thread.setName() invocation.
Desktop (please complete the following information):
- OS: Windows 10
- JDK version: 1.8.0_65
- Version: 1.4.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the VisualVM Threads tab and reproduce the issue with a thread pool whose thread calls Thread.setName(). Trace how the thread list refreshes after the name changes, then verify that the displayed name updates without closing and reopening the JVM tab.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100