Hi guys,
I'm currrently reviewing the pending JIRA's on MINA 2.0 branch (and there are many !). I was able to fix the long lasting issue with session remaining in pending state when being closed while some messages were nt written to the remote peer. That should fix an issue in SSHd. Now, I'm trying to fix DIRMINA-1041 (writeFuture is not always updated when a session is being closed on a remote peer, leaving the connection pending). This is a different flavor of the previous problem. At the same time, I discovered that under stress, the NioProcessor thread was creating a *lot* of new Selector (and on a loop of 1000 sessions being created, 9% of them ended with the creation of a new selector). This is really problematic, and might very well lead to a performance degradation. For the record, we create a new selector when we have some good reason to think that the current seletor is not any more working well : typically, when the select(TIMEOUT) call returns immediately with 0 selected keys, and no wakeup/interrupt has occured (this is a well lnow NIO bug, which has not been fixed for more than a decade, may thinks to the SUN then Oracle JDK developpers...). When we detect this bad behaviour, we assume the selector is broken, we create a new one and register all the keys on this selector. If we have plenty of keys, this is an expensive operation. In order to limit the number of selector being created, I give the current selector some 'room' : we try more than once to do a select(), and we bail out after ten unsuccessful select() - ie all of the select() calls return a wrong 0 result -. Doing that, no new selector is being created... I have no idea why calling twice the select() method works, but in any case, it should nbot hurt us. Next will be the integration fo DIRMINA-1039 patch. If all goes well, I expect to cut a release soon. Thanks !
