[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    Re: [freetds] Multiple connection retries to the same IP address
From:       Frediano Ziglio <freddy77 () gmail ! com>
Date:       2016-04-18 19:54:12
Message-ID: CAHt6W4e0vBS9rYFgGryydSFp9X67cWuEd-8BerdXUs7MNsK8Ow () mail ! gmail ! com
[Download RAW message or body]

Well, if you want you can test it works as expected for you :)
Already pushed the patch.

Frediano


2016-04-18 20:23 GMT+01:00 Jan Blom <jan.blom@peopleinteractive.se>:
> Excellent! Anything more I need to do?
> 
> 
> Best regards,
> Jan
> 
> -----Original Message-----
> From: FreeTDS [mailto:freetds-bounces@lists.ibiblio.org] On Behalf Of Frediano \
>                 Ziglio
> Sent: den 18 april 2016 20:00
> To: FreeTDS Development Group
> Subject: Re: [freetds] Multiple connection retries to the same IP address
> 
> 2016-04-18 17:56 GMT+01:00 Jan Blom <jan.blom@peopleinteractive.se>:
> > Hello,
> > 
> > I'm using FreeTDS 0.95 and have been puzzled why the connection timeout setting \
> > seemed not to work. Digging into the problem I notice the same target IP address \
> > always appear three times, for instance looking at the config dump from osql. I \
> > have provided the fqdn name for the host in freetds.conf. 
> > The FreeTDS implementation will loop over all IP addresses when trying to connect \
> > if there is a failure. This results in a 3x total timeout duration compared to \
> > the configuration. I cannot see a good reason for this logic, given it is the \
> > same IP address in all three attempts. 
> > The reason is that the call to getaddrinfo (in tds/config.c) doesn't send in any \
> > preference regarding address type. Therefore we get back something like this: 
> > 1.
> > Family        : AF_INET
> > Type          : SOCK_STREAM
> > Protocol      : IPPROTO_TCP
> > Socket address: ('23.235.43.223', 0)
> > 
> > 2.
> > Family        : AF_INET
> > Type          : SOCK_DGRAM
> > Protocol      : IPPROTO_UDP
> > Socket address: ('23.235.43.223', 0)
> > 
> > 3.
> > Family        : AF_INET
> > Type          : SOCK_RAW
> > Protocol      : IPPROTO_IP
> > Socket address: ('23.235.43.223', 0)
> > 
> > However, later on , when we actually connect the socket we will use SOCK_STREAM \
> > only. We don't care about UDP or raw sockets. 
> > My assumption would be that the tds_lookup_host() function should set
> > hints.ai_socktype = SOCK_STREAM;
> > 
> > This will result in only #1 above in return.
> > 
> > Does this make sense or am I missing something here?
> > 
> > 
> > Thanks for your time and support!
> > Jan Blom
> > 
> 
> 
> Make sense. It's just that the change was quite recent, previously we took into \
> account just the first address so we didn't had this issue. I think your suggestion \
> should go as a patch. 
> Frediano
> _______________________________________________
> FreeTDS mailing list
> FreeTDS@lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> _______________________________________________
> FreeTDS mailing list
> FreeTDS@lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic