infinity loop in AbstractPollingIoProcessor.Processor.run if connection is 
closed
---------------------------------------------------------------------------------

                 Key: DIRMINA-808
                 URL: https://issues.apache.org/jira/browse/DIRMINA-808
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.1
            Reporter: Ertong


While making some stress tests of my application, that uses mina on client and 
server sides, I discovered that sometimes mina leaves some threads to work 
after session.close(false) and connector.dispose(false).

ExceptionMonitor says that there is an exception

java.nio.channels.ClosedSelectorException
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:66)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at 
org.apache.mina.transport.socket.nio.NioProcessor.select(NioProcessor.java:70)
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1067)
        at 
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Then I tried to dig deeper. And I've found the loop in 
AbstractPollingIoProcessor.Processor.run

            for (;;) {
                try {
                    int selected = select(SELECT_TIMEOUT);
                                        //...
                } catch (Throwable t) {
                    ExceptionMonitor.getInstance().exceptionCaught(t);
                                        //...
                }
            }

This loop is definitely infinite, if select throws ClosedSelectorException.

So, ClosedSelectorException have to be processed with another way.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to