Hello,
Please, always CC to me as the mailing list is losing some
emails to my mbox, stopping delivery from time to time...
On Wed, 2 Nov 2005, Roberto Nibali wrote:
> I don't exactly know what happens here right now, but the following
> setup does not expire the persistent template anymore:
> 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
The following is valid only for conns with wrong refcnt, not
for templates:
> Aug 30 07:36:20 s_int@lb-lb0-phys IPVS: delayed: conn->refcnt-1=5
> conn.n_control=0
>
> 15 seconds later, when the template timer is expiring, somehow it seems
> like cp->n_control is 1 and thus we again are bounced to expire_later
> which then prints following situation:
n_control=1, sounds better, it is template that can not
expire because single normal conn holds it.
> Aug 30 07:36:35 s_int@lb-lb0-phys IPVS: delayed: conn->refcnt-1=1
> conn.n_control=1
>
> This confuses me, do you guys have an explanation? Somehow I mucked up
> the dest->refcnt stuff ...
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;
}
|