So I moved on to wildfly-core where I think are the last points
where
groups are created.
I tried to remove the ThreadGroup creation altogether, and if there was
"%G" used in the name pattern I replaced it with the original thread
group name, so in effect there should be no change in the names of the
threads.
One consequence of not using these ThreadGroups and just appending the expected name is
that could make debugging more difficult [1].
In such a case, maybe it is worth keeping static ThreadGroup references to keep the
organizational structure, at least until there is a new thread-organizing construct in
future JDK versions.
[1]
https://bugs.openjdk.org/browse/JDK-8252885
>
> One more interesting place I found is the thread-factory resource
> (ThreadFactoryResourceDefinition) which allows a user to define custom
> thread factory and define the priority, group name and name pattern
> attributes. The priority is however not set via the ThreadGroup
> instance but directly on created threads, so the ThreadGroup is still
> mostly a decoration.
>
>
https://github.com/wildfly/wildfly-core/pull/5672
>
> Regards,
> Tomas