Re: external_acl helper question

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Thu, 23 May 2013 11:35:54 -0600

On 05/23/2013 09:52 AM, Chris Ross wrote:

> So, there isn't a variant of fastCheck that simply _will_
> call the slow acl mechanism, without having to deal with the async mechanisms
> apparently in play with nonBlockingCheck()?

That would be technically impossible without a lot of code changes and a
bad idea even if you do not mind code changes.

Consider a DNS lookup as an example of a slow ACL. A DNS lookup may take
a few seconds or, in case of packet loss, a minute or two. Current code
implements lookup in a non-blocking way: a DNS query is sent and Squid
continues to serve other traffic until it notices a response.

Even if you rewrite the DNS code to block and wait for that response (so
that a blocking fastCheck() call works with DNS queries), do you really
want Squid to wait for a few minutes in fastCheck() while not serving
any other transactions? No, you do not.

That is why there are two kinds of ACLs and two kinds of ACL checks.
Note that if Squid was allocating a dedicated thread for every
transaction, that would not have been necessary -- the thread could
block for a few minutes while other threads were running. This
complexity comes from the need to combine "long" queries such as DNS
lookups with handling of thousands of transactions per second within one
monolithic process.

HTH,

Alex.
Received on Thu May 23 2013 - 17:36:10 MDT

This archive was generated by hypermail 2.2.0 : Thu May 23 2013 - 12:01:10 MDT