mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: closing a session in Mina 2.0.0-M6
Date Sat, 06 Jun 2009 13:48:16 GMT
Kelly Wiles wrote:
> I changed the code to do the following when the disconnect method is 
> called in my IoHandlerAdapter.
> <snip/>

> The "here 1" and 2 are printed then a 60 second pause.
> Then the command shell prompt appears.
> The "here 3" and 4 are not printed.
>
> So the call to cf.awaitUninterruptibly(CONNECT_TIMEOUT); blocks for 60 
> seconds.
>
> Do I need to do the connector.dispose() before the do the wait?
No, certainly not.
> I am probably doing stuff out of order I am thinking.
Nope, it's correct.

Now, looking at MINA's code, I see no place you can be blocked in for 60 
seconds, except if your system time is not giving you a bad value. We 
have fixed a potential bug in await0( timeout ), but I don'ts ee how it 
can impact your code.

Hav you done a thread dump while your client is waiting for 60 seconds ? 
I would like to see which thread is blocking.

Also please give us the OS and java version.

Thanks !
>
> Kelly
>
> Emmanuel Lecharny wrote:
>> Kelly Wiles wrote:
>>> Hi
>>>
>>> When I close a session using the call
>>>    session.close(true).awaitUninterruptibly(3000);
>>>
>>> The session does not close for 60 seconds.
>> What do you mean ? Have you checked the CloseFuture.isClosed() result ?
>> CloseFuture closeFuture = session.close(true);
>> closeFuture.awaitUninterruptibly(3000);
>>
>> if (closeFuture.isDone()) {
>>  // The session is closed...
>> }
>>
>>> Is this the right way to shutdown a connection?
>> Yes, it will close the session.
>>>
>>> I am trying to send two messages to a server then once the responses 
>>> have returned I  shutdown my client program. But the client program 
>>> does not quit for 60 seconds.
>> You also have to dispose the Connector. Closing the session won't be 
>> enough.
>>
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 
>> 270.12.53/2156 - Release Date: 06/05/09 06:24:00
>>
>>   
>


-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message