You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by James Baldassari <jb...@gmail.com> on 2012/03/01 20:27:20 UTC

Re: NettyServer not setting TCP keep-alive leading to leaked connections

Hi Frank,

I read the thread you referenced.  So the root cause of the problem is that
the firewall is terminating the connection without doing a proper TCP
teardown, right?

This probably isn't a very common problem, but it seems like enabling TCP
keepalives in NettyServer (and on the client side as well) is a good idea
in general.  Are you sure that keepalives aren't enabled by default in
Netty?  I searched for a few minutes but couldn't find any documentation on
it.  Have you actually seen this socket leak with Avro when behind a
firewall?

We might want to also consider allowing the ServerBootstrap to be passed
into NettyServer via constructor or setter method.  That way these types of
settings could be tweaked without any Avro code changes.

Would you mind creating an issue for this?

Thanks,
James


On Wed, Feb 29, 2012 at 3:20 PM, Frank Grimes <fr...@gmail.com>wrote:

> Hi All,
>
> I think that NettyServer needs to be changed to include the following line:
>
> bootstrap.setOption("child.keepAlive", true);
>
> Otherwise, it'll be susceptible to the following problem:
>
> http://mail-archives.apache.org/mod_mbox/incubator-flume-user/201201.mbox/<71...@yahoo.com>
>
> Not sure if HttpServer is also affected by this because I haven't yet dug
> into the Jetty code to see if it sets TCP keep-alive on its sockets.
>
> Let me know if I should file a JIRA and/or provide a patch...
>
> Regards,
>
> Frank Grimes
>

Re: NettyServer not setting TCP keep-alive leading to leaked connections

Posted by Frank Grimes <fr...@gmail.com>.
Hi James,

I've tested and confirmed that without adding "bootstrap.setOption("child.keepAlive", true);", we get leaked connections just as we did with Flume/Thrift.
I've created https://issues.apache.org/jira/browse/AVRO-1040 to address the issue.

Cheers,

Frank Grimes


On 2012-03-01, at 2:27 PM, James Baldassari wrote:

> Hi Frank,
> 
> I read the thread you referenced.  So the root cause of the problem is that the firewall is terminating the connection without doing a proper TCP teardown, right?
> 
> This probably isn't a very common problem, but it seems like enabling TCP keepalives in NettyServer (and on the client side as well) is a good idea in general.  Are you sure that keepalives aren't enabled by default in Netty?  I searched for a few minutes but couldn't find any documentation on it.  Have you actually seen this socket leak with Avro when behind a firewall?
> 
> We might want to also consider allowing the ServerBootstrap to be passed into NettyServer via constructor or setter method.  That way these types of settings could be tweaked without any Avro code changes.
> 
> Would you mind creating an issue for this?
> 
> Thanks,
> James
> 
> 
> On Wed, Feb 29, 2012 at 3:20 PM, Frank Grimes <fr...@gmail.com> wrote:
> Hi All,
> 
> I think that NettyServer needs to be changed to include the following line:
> 
> 	bootstrap.setOption("child.keepAlive", true);
> 
> Otherwise, it'll be susceptible to the following problem:
> 	http://mail-archives.apache.org/mod_mbox/incubator-flume-user/201201.mbox/<71...@yahoo.com>
> 
> Not sure if HttpServer is also affected by this because I haven't yet dug into the Jetty code to see if it sets TCP keep-alive on its sockets.
> 
> Let me know if I should file a JIRA and/or provide a patch...
> 
> Regards,
> 
> Frank Grimes
>