You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by pi...@dokom.net on 2011/11/14 14:39:20 UTC
Loss of connection onece a minute
I have an application which loses the connection once a minute. I
could not find code that drops the line but it seems that my
application drops the line. The TCP FIN message comes from my
application. I use MINA version 2.0.0-RC1. The strange thing is that
the same application works like a charm for hours in my test
environment. The issues occur on production only.
How to debug in such a case? Is it possible to enable logging to get
more information from MINA?
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/23/11 8:21 AM, pinus wrote:
>
>
> Emmanuel Lecharny wrote:
>> Even if you implement the exceptionCaught() event in your handler ?
>>
> I implemented a org.apache.mina.core.service.IoHandlerAdapter with:
>
> @Override
> public void exceptionCaught(IoSession session, Throwable throwable)
> {
> getLogger().log(Level.WARNING, "Exception during message processing",
> throwable);
> session.close(true);
> this.acknowleger.sessionClosed(session);
> }
>
> Is there another error handler to overwrite to get some more information
> from MINA?
no, it's ok. Did you get any logs ?
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/23/11 3:05 PM, pinus wrote:
>
>
> Emmanuel Lecharny wrote:
>> no, it's ok. Did you get any logs ?
>>
> Well, in this case I didn't get logs because it is an application issue. It
> is a threading issue in my application :-(
Makes sense...
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Loss of connection onece a minute
Posted by pinus <pi...@dokom.net>.
Emmanuel Lecharny wrote:
>
> no, it's ok. Did you get any logs ?
>
Well, in this case I didn't get logs because it is an application issue. It
is a threading issue in my application :-(
Thanks for your help!
--
View this message in context: http://old.nabble.com/Loss-of-connection-onece-a-minute-tp32840413p32874080.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/23/11 8:21 AM, pinus wrote:
>
>
> Emmanuel Lecharny wrote:
>> Even if you implement the exceptionCaught() event in your handler ?
>>
> I implemented a org.apache.mina.core.service.IoHandlerAdapter with:
>
> @Override
> public void exceptionCaught(IoSession session, Throwable throwable)
> {
> getLogger().log(Level.WARNING, "Exception during message processing",
> throwable);
> session.close(true);
> this.acknowleger.sessionClosed(session);
> }
>
> Is there another error handler to overwrite to get some more information
> from MINA?
no, it's ok. Did you get any logs ?
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Loss of connection onece a minute
Posted by pinus <pi...@dokom.net>.
Emmanuel Lecharny wrote:
>
> Even if you implement the exceptionCaught() event in your handler ?
>
I implemented a org.apache.mina.core.service.IoHandlerAdapter with:
@Override
public void exceptionCaught(IoSession session, Throwable throwable)
{
getLogger().log(Level.WARNING, "Exception during message processing",
throwable);
session.close(true);
this.acknowleger.sessionClosed(session);
}
Is there another error handler to overwrite to get some more information
from MINA?
--
View this message in context: http://old.nabble.com/Loss-of-connection-onece-a-minute-tp32840413p32873609.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/22/11 4:11 PM, pinus wrote:
>
>
> Julien Vermillard-2 wrote:
>> On Tue, Nov 22, 2011 at 11:22 AM, Emmanuel Lecharny<el...@gmail.com>
>> wrote:
>> You should try to capture the TCP stream with wireshark or tcpdump.
>> Could give you a clue about what is triggering the end of TCP session.
>>
> Sorry for the three posts, nabble.com crashed on me and I tried again before
> noticing that it already posted it.
>
> I already have a wireshark dump, it tells me that my application sends the
> TCP-FIN. I send a message, get an application ACK for it and send the next
> message. About 60ms later I send the TCP-FIN.
>
> I have a ProtocolEncoder and ProtocolDecoder which do log the traffic. Is
> the registered logger something else?
>
> I have logging before each session.close() message but I can not see a
> message. Everything looks like I'm waiting for the application ACK. During
> waiting another thread creates a sessionClosed() event. It's just a guess
> but it looks like the sending of the message fails (produces an error) which
> close the session. Between sending the message and the sessionClosed() are
> about 60ms. The strange thing is that I can't see any error.
Even if you implement the exceptionCaught() event in your handler ?
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Loss of connection onece a minute
Posted by pinus <pi...@dokom.net>.
Julien Vermillard-2 wrote:
>
> On Tue, Nov 22, 2011 at 11:22 AM, Emmanuel Lecharny <el...@gmail.com>
> wrote:
> You should try to capture the TCP stream with wireshark or tcpdump.
> Could give you a clue about what is triggering the end of TCP session.
>
Sorry for the three posts, nabble.com crashed on me and I tried again before
noticing that it already posted it.
I already have a wireshark dump, it tells me that my application sends the
TCP-FIN. I send a message, get an application ACK for it and send the next
message. About 60ms later I send the TCP-FIN.
I have a ProtocolEncoder and ProtocolDecoder which do log the traffic. Is
the registered logger something else?
I have logging before each session.close() message but I can not see a
message. Everything looks like I'm waiting for the application ACK. During
waiting another thread creates a sessionClosed() event. It's just a guess
but it looks like the sending of the message fails (produces an error) which
close the session. Between sending the message and the sessionClosed() are
about 60ms. The strange thing is that I can't see any error.
The same message that could not be send is sent after the reconnect.
The machine that hosts the application is a Windows cluster server which
host other applications which do run without problem using the same network
hardware.
--
View this message in context: http://old.nabble.com/Loss-of-connection-onece-a-minute-tp32840413p32872666.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Loss of connection onece a minute
Posted by Julien Vermillard <jv...@gmail.com>.
On Tue, Nov 22, 2011 at 11:22 AM, Emmanuel Lecharny <el...@gmail.com> wrote:
> On 11/22/11 10:55 AM, pinus wrote:
>>
>> Emmanuel Lecharny wrote:
>>>
>>> Two things :
>>> - you should urgently switch to 2.0.4, the latest (and stable) MINA
>>> version. 2.0.0-RC1 is really old and buggy.
>>> - your production TCP stack is likely to kill inactive TCP connections
>>> after a 60 seconds delay. You should check your OS setting.
>>> (http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
>>>
>> I upgraded to version 2.0.4 but the problem persists.
>>
>> The last successful message was send about one second before.
>> The acknowledgement the program is waiting for was send about 80ms
>> before receiving sessionDestroyed().
>>
>> I doubt that this is a KeepAlive issue. I checked the registry and the
>> KeepAlive
>> key is not set, meaning it is using the defaults. The other side uses
>> defaults, too.
>> And the defaults are far away from one second.
>>
>> How to make the return codes of the TCP stack visible?
>
> No need to send the same message 3 times...
>
> You said that the application is working fine in a test environment, but not
> on a production server. Now, just asks yourself : what is the changing piece
> ? Certainly not MINA. Keep digging on the TCP configuration on the server
> and client. And don't forget any in the middle firewall, router etc.
>
> Or maybe you are not dealing with the same messages, and you've got some
> error which has been un-noticed on the test env.
>
> In any case, you can inject a Logger interceptor on your chain to see what's
> going on.
>
>
You should try to capture the TCP stream with wireshark or tcpdump.
Could give you a clue about what is triggering the end of TCP session.
Julien
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/22/11 10:55 AM, pinus wrote:
>
> Emmanuel Lecharny wrote:
>> Two things :
>> - you should urgently switch to 2.0.4, the latest (and stable) MINA
>> version. 2.0.0-RC1 is really old and buggy.
>> - your production TCP stack is likely to kill inactive TCP connections
>> after a 60 seconds delay. You should check your OS setting.
>> (http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
>>
> I upgraded to version 2.0.4 but the problem persists.
>
> The last successful message was send about one second before.
> The acknowledgement the program is waiting for was send about 80ms
> before receiving sessionDestroyed().
>
> I doubt that this is a KeepAlive issue. I checked the registry and the
> KeepAlive
> key is not set, meaning it is using the defaults. The other side uses
> defaults, too.
> And the defaults are far away from one second.
>
> How to make the return codes of the TCP stack visible?
No need to send the same message 3 times...
You said that the application is working fine in a test environment, but
not on a production server. Now, just asks yourself : what is the
changing piece ? Certainly not MINA. Keep digging on the TCP
configuration on the server and client. And don't forget any in the
middle firewall, router etc.
Or maybe you are not dealing with the same messages, and you've got some
error which has been un-noticed on the test env.
In any case, you can inject a Logger interceptor on your chain to see
what's going on.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Loss of connection onece a minute
Posted by pinus <pi...@dokom.net>.
Emmanuel Lecharny wrote:
>
> Two things :
> - you should urgently switch to 2.0.4, the latest (and stable) MINA
> version. 2.0.0-RC1 is really old and buggy.
> - your production TCP stack is likely to kill inactive TCP connections
> after a 60 seconds delay. You should check your OS setting.
> (http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
>
I upgraded to version 2.0.4 but the problem persists.
The last successful message was send about one second before.
The acknowledgement the program is waiting for was send about 80ms
before receiving sessionDestroyed().
I doubt that this is a KeepAlive issue. I checked the registry and the
KeepAlive
key is not set, meaning it is using the defaults. The other side uses
defaults, too.
And the defaults are far away from one second.
How to make the return codes of the TCP stack visible?
--
View this message in context: http://old.nabble.com/Loss-of-connection-onece-a-minute-tp32840413p32872294.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Loss of connection onece a minute
Posted by pinus <pi...@dokom.net>.
Emmanuel Lecharny wrote:
>
> Two things :
> - you should urgently switch to 2.0.4, the latest (and stable) MINA
> version. 2.0.0-RC1 is really old and buggy.
> - your production TCP stack is likely to kill inactive TCP connections
> after a 60 seconds delay. You should check your OS setting.
> (http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
>
I upgraded to version 2.0.4 but the problem persists.
The last successful message was send about one second before.
The acknowledgement the program is waiting for was send about 80ms
before receiving sessionDestroyed().
I doubt that this is a KeepAlive issue. I checked the registry and the
KeepAlive
key is not set, meaning it is using the defaults. The other side uses
defaults, too.
And the defaults are far away from one second.
How to make the return codes of the TCP stack visible?
--
View this message in context: http://old.nabble.com/Loss-of-connection-onece-a-minute-tp32840413p32872293.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Loss of connection onece a minute
Posted by pinus <pi...@dokom.net>.
Emmanuel Lecharny wrote:
>
> Two things :
> - you should urgently switch to 2.0.4, the latest (and stable) MINA
> version. 2.0.0-RC1 is really old and buggy.
> - your production TCP stack is likely to kill inactive TCP connections
> after a 60 seconds delay. You should check your OS setting.
> (http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
>
>
I upgraded to version 2.0.4 but the problem persists.
The last successful message was send about one second before.
The acknowledgement the program is waiting for was send about 80ms
before receiving sessionDestroyed().
I doubt that this is a KeepAlive issue. I checked the registry and the
KeepAlive
key is not set, meaning it is using the defaults. The other side uses
defaults, too.
And the defaults are far away from one second.
How to make the return codes of the TCP stack visible?
--
View this message in context: http://old.nabble.com/Loss-of-connection-onece-a-minute-tp32840413p32872297.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/14/11 2:39 PM, pinus@dokom.net wrote:
> I have an application which loses the connection once a minute. I
> could not find code that drops the line but it seems that my
> application drops the line. The TCP FIN message comes from my
> application. I use MINA version 2.0.0-RC1. The strange thing is that
> the same application works like a charm for hours in my test
> environment. The issues occur on production only.
>
> How to debug in such a case? Is it possible to enable logging to get
> more information from MINA?
Two things :
- you should urgently switch to 2.0.4, the latest (and stable) MINA
version. 2.0.0-RC1 is really old and buggy.
- your production TCP stack is likely to kill inactive TCP connections
after a 60 seconds delay. You should check your OS setting.
(http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html)
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: Loss of connection onece a minute
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/14/11 4:01 PM, Buğra Çakır wrote:
> Hi,
>
> Also i have encountered the same issue in Mina 1.1.7.
For the same reason.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
RE: Loss of connection onece a minute
Posted by Buğra Çakır <bu...@mobiliz.com.tr>.
Hi,
Also i have encountered the same issue in Mina 1.1.7.
Best,
Bugra
-----Original Message-----
From: pinus@dokom.net [mailto:pinus@dokom.net]
Sent: Monday, November 14, 2011 3:39 PM
To: users@mina.apache.org
Subject: Loss of connection onece a minute
I have an application which loses the connection once a minute. I
could not find code that drops the line but it seems that my
application drops the line. The TCP FIN message comes from my
application. I use MINA version 2.0.0-RC1. The strange thing is that
the same application works like a charm for hours in my test
environment. The issues occur on production only.
How to debug in such a case? Is it possible to enable logging to get
more information from MINA?