Details
Description
The existing implementation of DynamicAcceptorSessionProvider does not correctly handle the case where a client disconnects due to network failure - the DynamicAcceptorSessionProvider never detects the disconnect, and the connection appears to still be "active" and the Session is never removed.
As a result, when the client subsequently tries to reconnect, QFJ thnks that is already connected and does not allow for the new connection.
The DynamicAcceptorSessionProvider is setup to accept all incoming connections (based on a specified template). Currently, a new session is created and added to the sessions list, but if you are running a SingleThreadedEventHandlingStrategy the new session is never added to the list of sessions for the SessionConnector.
As a result the main SessionConnector.SessionTimerTask loop that goes through all the known connections and calls Session.next() on them (which tries to send TestRequest to those it hasn't heard from in a while) is never executed for the dynamically-created connections.
The solution is to have the SessionConnector be available to the DynamicAcceptorSessionProvider class, and to add the session to the list of sessions at creation.
You can reproduce this by changing the Executor example to use the DynamicAcceptorSessionProvider, and then connecting to it via Banzai from a different machine.
Disconnect the network cable, wait 2 mins, try to reconnect - the vanilla version of QFJ won't let you re-login b/c it still thinks the first session is active.
With the patch, it'll detect lack of hearbeats and forcibly disconnect the session.