directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Kumpera (JIRA)" <>
Subject [jira] Created: (DIRMINA-81) race condition in SocketConnector::connect
Date Fri, 12 Aug 2005 17:56:54 GMT
race condition in SocketConnector::connect

         Key: DIRMINA-81
     Project: Directory MINA
        Type: Bug
    Versions: 0.7.3    
    Reporter: Rodrigo Kumpera
 Assigned to: Trustin Lee 

The problem happens in the connect method when the selector is waken up. The following scenario
will show the error:

-acquire "this" monitor
-acquire "connectQueue" monitor
-push the new request
-release "connectQueue" monitor
-call startupWorker() -> this will create the Selector and the Worker thread
-release  "this" monitor

worker thread:
-process the required connect request
-acquire "SocketConnector.this" monitor
-close the selector and assign null
-thread dies

main thread:
-tries to call selector.wakeup() and get a NullPointerException

This problem can be reproduced easily with the help of a debugger, put a breakpoint on "selector.wakeup()"
and wait for the Worker thread to die.

It seens that SocketConnector wan´t made with the purpoise of handling a lot of connect()
calls, but more like a single shot thing. It should behave more like a Service.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message