Max age for TCP connection

225 views
Skip to first unread message

david...@ft.com

unread,
Sep 13, 2016, 10:57:45 AM9/13/16
to golang-nuts
Hi,

We've got a HTTP client connecting to an active-passive cluster setup, controlled through a traffic managed DNS entry and a good-to-go signal on each cluster.  When the good-to-go fails, the DNS switches to point at the passive cluster.  The client in question has no knowledge of whether a failover has occurred, it's just hitting an endpoint on the traffic managed address.

The client is resolving the DNS correctly and opening a TCP connection.  However, when the failover occurs, the TCP connection to the old cluster stays active because of Go's persistent connections.  The connection is not idle (it still makes scheduled requests to the endpoint via its IP address) and so is not closed when we close all idle connections.

Is there some way to set a maximum age for the TCP connection?


This email was sent by a company owned by Financial Times Group Limited ("FT Group"), registered office at Number One Southwark Bridge, London SE1 9HL.  Registered in England and Wales with company number 879531. This e-mail may contain confidential information. If you are not the intended recipient, please notify the sender immediately, delete all copies and do not distribute it further.  It could also contain personal views which are not necessarily those of the FT Group.  We may monitor outgoing or incoming emails as permitted by law.

C Banning

unread,
Sep 13, 2016, 11:41:38 AM9/13/16
to golang-nuts
What is your http.Client.Timeout value?

Johnny Luo

unread,
Sep 13, 2016, 11:29:10 PM9/13/16
to golang-nuts
Hi David, 

   I saw similar solutions using DNS to add / remove node  from cluster,  the client side spin up a go routine keep resolving the DNS in an interval, if it find new ip appears in DNS record, add it to the pool , when ip address disappear from the DNS, it removes from the pool.
   
   and it seems to me that DNS is cached in os level.
Reply all
Reply to author
Forward
0 new messages