Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The client creates various executors, supplying thread factories to set the names and daemon status. It typically does this using an anonymous inner class for the factory, and doing this results in the factory object having an implicit reference to its creating class instance, which in most cases makes them a way to reference the objects for a connection. This can at best make connection objects stick around longer than needed/desired when done with, but at worst during any resource cleanup issues could actually retain the connections related objects indefinitely and exhaust memory if this repeats often enough over time.
We should create a common thread factory class that can avoid the existing duplicate code and ensure the thread factories don't have the impicit reference to their creators which can lead to undesirable retention.