Hi,

The feature is null and there is not an exception at this code, but when I 
tested both Mina 2.2.1 and 2.2.5 and debug in parallel seems this code is not 
invoked for 2.2.5

((AbstractIoService) 
session.getService()).getListeners().fireSessionDestroyed(session);

fireSessionDestroyed is not invoked I think because of ClassNotFoundException 
of AbstractIoService and now I will investigate is there something missing in 
our setup.

The same method in Mina is working for 2.2.1
Regards,Tatyana





    On Wednesday, April 22, 2026 at 02:45:21 AM GMT+3, Emmanuel Lecharny 
<[email protected]> wrote:  
 
 Hi

On 4/21/26 16:49, T.Nalbantova via dev wrote:
>  Actually the issue is from Mina 2.2.3 and now I try to find how to 
>fix/workaround sessionClosed to be invoked in case of TLS error, because 
>sessionClosed invokes the method onDisconnect of the apache ftplet.


If you get a TLS error, an SSLException should be thrown, and at the 
end, it should be handled in the AbstractPollingIoProcess.read(session 
method:

...

} catch(Exception e) {

if((einstanceofIOException) &&

(!(einstanceofPortUnreachableException)

|| !AbstractDatagramSessionConfig.class.isAssignableFrom(config.getClass())

|| ((AbstractDatagramSessionConfig) config).isCloseOnPortUnreachable())) {

scheduleRemove(session);

}

IoFilterChain filterChain= session.getFilterChain();

filterChain.fireExceptionCaught(e);

}

}

The fireExceptionCaught method will close the session immediately:

/**

* {@inheritDoc}

*/

@Override

publicvoidfireExceptionCaught(Throwable cause) {

callNextExceptionCaught(head, session, cause);

}

privatevoidcallNextExceptionCaught(Entry entry, IoSession session, 
Throwable cause) {

// Notify the related future.

ConnectFuture future= (ConnectFuture) 
session.removeAttribute(SESSION_CREATED_FUTURE);

if(future== null) {

try{

IoFilter filter= entry.getFilter();

NextFilter nextFilter= entry.getNextFilter();

filter.exceptionCaught(nextFilter, session, cause);

} catch(Throwable e) {

LOGGER.warn("Unexpected exception from exceptionCaught handler.", e);

}

} else{

// Please note that this place is not the only place that

// calls ConnectFuture.setException().

if(!session.isClosing()) {

// Call the closeNow method only if needed

session.closeNow();

}

future.setException(cause);

}

}

I have not a running test atm, so it's from the top of my head...

  

Reply via email to