OF-883: Compensate for new half-duplex close of TCP channel in MINA
MINA 2.0.8 introduces support for half-duplex close of TCP channels (see DIRMINA-785). As part of this change, IoHandlers got a new method. The default behavior of the IoHandlerAdapter closes the MINA session when this handler is triggered. However, without an Openfire-specific extension (in ConnectionHandler), this fails to close Openfire-maintained resources. As a result, CPUs could start to spin in NIO code, resulting in 100% CPU cycles. To fix this issue, ConnectionHandler now overrides the default functionality and triggers a normal closure of the session (both in Openfire as well as MINA context). Additionally, to prevent the CPU spin, MINA sessions need to be closed synchronously (as opposed to the async closure Openfire had up until now). I cannot quite explain the need for this change, other than a suspision of race conditions in the async setup.
Showing
Please register or sign in to comment