LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: IPVS-2.4: ip_vs_conn_expire() ping pong for persistent template

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: IPVS-2.4: ip_vs_conn_expire() ping pong for persistent template
Cc: Julian Anastasov <ja@xxxxxx>
From: Roberto Nibali <ratz@xxxxxx>
Date: Thu, 03 Nov 2005 09:01:14 +0100
Hi Julian,

>>What happens is, that 15 seconds before the template timer expires,
>>ip_vs_conn_expire() is called and cp->n_control is 0 and we hit
>>ip_vs_conn_unhash() which seems to fail and we are bounced to
>>expire_later which then prints following line:
> 
>       May be _unhash does not fail, more likely it jumps because
> refcnt != 1. The question is does it happen for normal connections
> or for templates. It is usual to see templates failing to expire if
> their n_control>0

I saw it on templates but I just realised that I ran a ipvsadm -L -n -c
| grep NONE, so my observation is biased.

>       The following is valid only for conns with wrong refcnt, not
> for templates:

Yes, I didn't display all connection entries unfortunately. I will
however, once this happens again.

>       n_control=1, sounds better, it is template that can not
> expire because single normal conn holds it.

So at least one conn was stuck. [BTW, you certainly noticed how I did
tidy up the IP_VS_DBG statements a bit, so normal people like me have a
chance to interprete the output a bit quicker.]

>       It seems we forgot to fix one place where ip_vs_conn_expire_now
> is used. Callers should hold write lock or cp->refcnt (and not to
> forget it). Please, try the appended patch, on success resend it to 
> Marcelo. Such problem exists in 2.6.13 too, for all expire_nodest_conn 
> users. The same patch applies to 2.6.14, so we should send it for 2.6
> inclusion.
> 
> Signed-off-by: Julian Anastasov <ja@xxxxxx>
> 
> diff -ur v2.4.32-rc2/linux/net/ipv4/ipvs/ip_vs_core.c 
> linux/net/ipv4/ipvs/ip_vs_core.c
> --- v2.4.32-rc2/linux/net/ipv4/ipvs/ip_vs_core.c      2005-11-03 
> 01:20:02.000000000 +0200
> +++ linux/net/ipv4/ipvs/ip_vs_core.c  2005-11-03 01:22:36.347895544 +0200
> @@ -1111,11 +1111,10 @@
>               if (sysctl_ip_vs_expire_nodest_conn) {
>                       /* try to expire the connection immediately */
>                       ip_vs_conn_expire_now(cp);
> -             } else {
> -                     /* don't restart its timer, and silently
> -                        drop the packet. */
> -                     __ip_vs_conn_put(cp);
>               }
> +             /* don't restart its timer, and silently
> +                drop the packet. */
> +             __ip_vs_conn_put(cp);
>               return NF_DROP;

Looks totally reasonable to me. So we also return NF_DROP and drop the
refcnt for the ip_vs_conn_expire_now(cp) case.

I'll test this right away, Thanks,
Roberto Nibali, ratz
-- 
-------------------------------------------------------------
addr://Kasinostrasse 30, CH-5001 Aarau tel://++41 62 823 9355
http://www.terreactive.com             fax://++41 62 823 9356
-------------------------------------------------------------
terreActive AG                       Wir sichern Ihren Erfolg
-------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>