You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2010/11/29 22:10:16 UTC

[jira] Resolved: (DIRMINA-808) infinity loop in AbstractPollingIoProcessor.Processor.run if connection is closed

     [ https://issues.apache.org/jira/browse/DIRMINA-808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRMINA-808.
---------------------------------------

    Resolution: Fixed

Good catch !

I think that http://svn.apache.org/viewvc?rev=1040294&view=rev fixes it. Can you confirm ?

> 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.