You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Niklas Therning (JIRA)" <ji...@apache.org> on 2006/04/05 09:15:44 UTC

[jira] Commented: (DIRMINA-202) Race condition in SocketAcceptorDelegate.unbind

    [ http://issues.apache.org/jira/browse/DIRMINA-202?page=comments#action_12373235 ] 

Niklas Therning commented on DIRMINA-202:
-----------------------------------------

Hmmm, I'm not sure this is a MINA problem actually. From the Javadoc of Selector.wakeup():

"... If no selection operation is currently in progress then the next invocation of one of these methods [select() or selectNow()] will return immediately unless the selectNow() method is invoked in the meantime. ..."

It could be a problem with GNU classpath. Would it be possible for you to test this using GNU classpath's NIO directly? It should be quite easy to verify that classpath's wakeup() functions as expected.

> Race condition in SocketAcceptorDelegate.unbind
> -----------------------------------------------
>
>          Key: DIRMINA-202
>          URL: http://issues.apache.org/jira/browse/DIRMINA-202
>      Project: Directory MINA
>         Type: Bug

>     Versions: 1.0
>     Reporter: John K Peterson

>
> On my system (Linux 2.4.22/JamVM 1.4.2/Classpath 0.90), ApacheDS gets stuck in SocketAcceptorDelegate.unbind.
> SocketAcceptorDelegate.unbind does the following:
> 1) creates a cancellation request
> 2) starts up a worker thread
> 3) puts the cancellation request on the cancelQueue
> 4) wakes up the worker thread's selector
> 5) waits for the cancellation request to be done
> The problem is that 4) assumes that 2) has gotten the worker thread to point where it has called selector.select().   However, there's no guarantee that the worker thread has gotten that far, in which case the wakeup occurs before the select and then the select hangs.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira