jetty.project
jetty.project copied to clipboard
Avoid cycles in bean dumps
Jetty version(s) 12.1.x
Description
EventListener added to a component may be copied to a subcomponent.
This is the case where we add e.g. a Connection.Listener to Connector, but then we copy the Connection.Listener to the actual Connection object every time the Connector creates a new one.
It may happen that one of the copied listeners is a container for the subcomponent, which will form a cycle (not in the bean graph, perhaps, but in the dump execution).
For example, when HTTP2SessionContainer is added as a listener to HTTP2Session: trying to dump the session results in trying to dump the container, which tries to dump the session, resulting in StackOverflowError.
We should have a generic mechanism to avoid this dump cycle.