Re: /bzr/squid3/trunk/ r11499: Upgrade comm layer Connection handling

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 22 Jun 2011 00:09:04 +1200

On 21/06/11 21:46, Tsantilas Christos wrote:
> On 06/19/2011 05:19 AM, Amos Jeffries wrote:
>> Comm no longer contains implicit DNS resolution. It needs to be given
>> the remote IP address before opening.
>
> Why?
> Looks that the best (and easier) way to solve the problem is to handle
> it in Comm::ConnOpener.
> A DNS lookup to get the ip address to connect to, looks like a job of
> the Comm::ConnOpener ...

DNS lookup is inside comm_open() in 3.1, that was the direct cause of
bug 3050, 3177. Most likely a big part of 3108. And a bunch of
look-alike bugs out in the distros.

ConnOpener opens a single TCP connection, from a Comm::Connection
"template".

DNS results produce multiple potential connections, across many address
families.

pconn selection, peer selection, and tcp_outgoing_address all have to be
done after DNS and prior to TCP open to avoid IP version problems. Their
ACL rely on high level details to make some of their determination from
so its not a good idea to push them down into the comm (TCP) layer.

>
>>
>> Since ServiceRep::getConnection() is strictly synchronous and assumes
>> that there is only one IP for the service.
>>
>> Xaction::openConnection() can become async so now contains:
>> "TODO: find the IPs and attempt each one if this is a named service"
>> marks the spot.
>>
>> For now it converts IP-addressed services using raw-IP text conversion
>> "remote= s.cfg().host.termedBuf()". Which is synchronous and
>> non-blocking but not resolving FQDN.
>>
>> When FQDN resolution is required do we ...
>>
>> a) split openConnection() into two async steps and only use one of the
>> possibly multiple IPs returned?
>>
>> OR
>>
>> b) lookup the DNS at some far earlier point and store the IPA in
>> ServiceRep for some sort of load balancing selection of just one by
>> getConnection()?
>>

This just needs:
   openConnection step 1 to call ipcache_nbgethostbyname()
   openConnection step 2 to do something similar to
src/peer_select.cc:peerSelectDnsResults() but tuned a bit for ICAP.

Do you want to take that on or shall I give it a try?

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.12
   Beta testers wanted for 3.2.0.9 and 3.1.12.3
Received on Tue Jun 21 2011 - 12:09:19 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 21 2011 - 12:00:04 MDT