You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Victor N (JIRA)" <ji...@apache.org> on 2009/07/02 17:19:47 UTC

[jira] Commented: (DIRMINA-642) Disposing an IoConnector blocks forever

    [ https://issues.apache.org/jira/browse/DIRMINA-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726513#action_12726513 ] 

Victor N commented on DIRMINA-642:
----------------------------------

I can confirm that the problem still exists in mina 2.0 M6. Not sure whether this is related to DIRMINA-632 or not.

I see the following stack trace:

"main" prio=10 tid=0x000000004995c000 nid=0x4a5c waiting on condition [0x00000000407cf000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for <0x00002aaab45d9ec0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
        at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1245)
        at org.apache.mina.core.service.AbstractIoService.dispose(AbstractIoService.java:305)

So we are blocked at ThreadPoolExecutor.awaitTermination. I tried to wait 15 minutes without success - always the same stack trace.
For me, the problem occurs when I shut down tomcat. In log file I see that connector continues handling i/o events as if it were not stopped.


As a workaround I would propose to add another dispose method to AbstractIoService:

void dispose(boolean awaitTermination);

This is something like IoSession.close(boolean immediately)

> Disposing an IoConnector blocks forever
> ---------------------------------------
>
>                 Key: DIRMINA-642
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-642
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M3
>         Environment: Linux
>            Reporter: Thomas Berger
>            Assignee: Edouard De Oliveira
>
> nHandles in the class Worker (AbstractPollingIoConnector) gets negative: -1 in my case.  Then the dispose() method blocks forever as the while loop in this worker class never breaks. Reproducing this error is pretty hard, as it usually happens after several hours. I will do a quick fix and check if nHandles<=0. 
> I think it may be related to http://issues.apache.org/jira/browse/DIRMINA-632 as I never block for a write in my app. However, I get some WriteToClosedSessionException. Is it possible that this causes nHandles to become negative?

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