[ http://issues.apache.org/jira/browse/DIRMINA-246?page=comments#action_12430319 ] Niklas Therning commented on DIRMINA-246: -----------------------------------------
Seems like you are calling session.close().join() in the thread which calls sessionCreated()? If that's the case removing the join() on the CloseFuture could help. > MINA (0.9.4) blocks with unbindAll while serveral clients were connected > ------------------------------------------------------------------------ > > Key: DIRMINA-246 > URL: http://issues.apache.org/jira/browse/DIRMINA-246 > Project: Directory MINA > Issue Type: Bug > Affects Versions: 0.9.4 > Environment: Windows XP, JDK 1.5.06 > Reporter: Frederic Bregier > Attachments: 2dumps.txt > > > After a post on the mailing list, as asked, I post a JIRA request: > I wanted to offer a function to shutdown gracefully the server, > that is to say that the server doesn't accept new connection, > but does let already connected client to finished correctly > their session (which are multi messages related). > In the beginning I used: > - setDisconnectOnUnbind(false) > - unbindAll() > - wait in my business logic that all already connected users shutting down > - setDisconnectOnUnbind(true) > - unbindAll() > I've got a lot of freeze (using 6 clients making a lot of messages) > in either the first or the second unbindAll(). > So I simplify like this: > - I am waiting in my business logic that all already connected users shutting > down and does not accept new connection by hand (business logic). > To make that, when I have the global static boolean shutdown as True, > every new connexion are immediately closed by the server. > Also, every pending connexion will finished their session, and when > finished, the server also closed the connexion. > The session used to send the shutdown order is closed immediately > after receiving the order. > - setDisconnectOnUnbind(true) > - unbindAll() > I still have easily a freeze in the server during the call to > unbindAll(). > - If I have only 1 client, unbindAll is never blocking. > - If I have 2 to 6 clients, making their stuff, they all disconnected > correctly from the server (the server is closing the session itself). > I saw that every clients are getting correctly the closed event. > But the server often blocks during the call of unbindAll(). > I am no able at this time to see where is the problem in MINA. > Everything seems ok for me from the point of vue of a programmer > using MINA. But I surely make some mistakes since it seems > that I am the only one to have this problem. > Could it be related to the fact that this is the server that is > forcing the close of the session ? > The only thing I can tell now is that it is blocling during the > call of unbindAll() in the server part. > I attached two thread dumps in one file : the first is when the server is > completely started and functionnal, the second after it blocks. > I generate these dump using jdb since I was not able to generate them > directly). > I hope this can clarify where is the problem. > Frederic Bregier -- 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
