Transport request handlers should be registered safely
#53,178 opened on Mar 5, 2020
Description
Similar to #38560 and #51622, the HandledTransportAction registers a non-static inner class with the transport service as the handler for the requests of a given action as seen below.
In the other issues, a reference to the instance being constructed, this, was explicitly passed to another service. In this case, the reference is implicit since the inner class TransportHandler is not static and has a reference to the outer class. Since the inner class is published and calls methods within the outer class, there is a chance that this could happen before the outer class is fully constructed, which violates the JLS.
For correctness, this code should be changed so that the handler registration no longer occurs within a constructor. However, given the use of guice to construct transport actions and eventual refactoring to remove guice it may be best to consider this as part of that effort.