[squid-users] IPv4 addresses go missing - markAsBad wrong?

Alex Rousskov rousskov at measurement-factory.com
Tue Jan 9 15:42:15 UTC 2024


On 2024-01-09 05:56, Stephen Borrill wrote:
> On 09/01/2024 09:51, Stephen Borrill wrote:
>> On 09/01/2024 03:41, Alex Rousskov wrote:
>>> On 2024-01-08 08:31, Stephen Borrill wrote:
>>>> I'm trying to determine why squid 6.x (seen with 6.5) connected via 
>>>> IPv4-only periodically fails to connect to the destination and then 
>>>> requires a restart to fix it (reload is not sufficient).
>>>>
>>>> The problem appears to be that a host that has one address each of 
>>>> IPv4 and IPv6 occasionally has its IPv4 address go missing as a 
>>>> destination. On closer inspection, this appears to happen when the 
>>>> IPv6 address (not the IPv4) address is marked as bad.

> ipcache.cc(990) have: [2001:4860:4802:32::78]:443 at 0 in 216.239.38.120 #1/2-0


Thank you for sharing more debugging info!

The above log line is self-contradictory AFAICT: It says that the cache 
has both IPv6-looking and IPv4-looking address at the same cache 
position (0) and, judging by the corresponding code, those two IP 
addresses are equal. This is not possible (for those specific IP address 
values). The subsequent Squid behavior can be explained by this 
(unexplained) conflict.

I assume you are running official Squid v6.5 code.

I can suggest the following two steps for going forward:

1. Upgrade to the latest Squid v6 in hope that the problem goes away.

2. If the problem is still there, patch the latest Squid v6 to add more 
debugging in hope to explain what is going on. This may take a few 
iterations, and it will take me some time to produce the necessary 
debugging patch.


HTH,

Alex.


>>>> Note that there have been many connections to 
>>>> clientservices.googleapis.com prior to this where markAsBad was not 
>>>> called, even though IPv6 connectivity was never available.
>>>
>>> No markAsBad() is probably normal if Squid did not try to establish 
>>> an IPv6 connection or did not wait long enough to know the result of 
>>> that attempt. However, that does not explain why Squid selected an 
>>> IPv6 address as the next "good" address right after marking that IPv6 
>>> address as bad (at "restoreGoodness" line) when there was another 
>>> good IP address available. It is as if Squid stored two identical 
>>> IPv6 addresses (and not IPv4 ones), but that should not happen either.
>>
>> This is tangentially related to this thread too:
>> https://lists.squid-cache.org/pipermail/squid-users/2023-November/026266.html
>>
>> Once only the IPv6 address is being used, then it returns 503 for that 
>> host and thus can quickly get marked as dead by a downstream squid 
>> meaning it does not get used at all (and if it's the only peer all 
>> access stops).
>>
> 
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> https://lists.squid-cache.org/listinfo/squid-users



More information about the squid-users mailing list