[master] e98521d Eliminate a WRONG() which triggered when we recycle a backend connection in c00040. (Strictly speaking I think it is a buglet in the FreeBSD kqueue implementation but that's for Varnish to live with and me to pester somebody about.)

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 24 12:18:49 CET 2015


commit e98521d0f61d9216dff0291f5b305c56efe3850c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 24 11:17:18 2015 +0000

    Eliminate a WRONG() which triggered when we recycle a backend
    connection in c00040.  (Strictly speaking I think it is a buglet
    in the FreeBSD kqueue implementation but that's for Varnish to live
    with and me to pester somebody about.)

diff --git a/bin/varnishd/waiter/cache_waiter_kqueue.c b/bin/varnishd/waiter/cache_waiter_kqueue.c
index 7fd8685..dfc8596 100644
--- a/bin/varnishd/waiter/cache_waiter_kqueue.c
+++ b/bin/varnishd/waiter/cache_waiter_kqueue.c
@@ -123,14 +123,19 @@ vwk_sess_ev(const struct vwk *vwk, const struct kevent *kp, double now)
 
 	idle = now - *vwk->waiter->tmo;
 
-	if (kp->data > 0) {
-		Wait_Handle(vwk->waiter, sp, WAITER_ACTION, now);
-	} else if (sp->idle <= idle) {
+	VSL(SLT_Debug, 0, "KQR d %ju filter %d data %jd flags 0x%x idle %g",
+	    kp->ident, kp->filter, kp->data, kp->flags, sp->idle - idle);
+	if (sp->idle <= idle) {
 		Wait_Handle(vwk->waiter, sp, WAITER_TIMEOUT, now);
 	} else if (kp->flags & EV_EOF) {
 		Wait_Handle(vwk->waiter, sp, WAITER_REMCLOSE, now);
 	} else {
-		WRONG("unknown kqueue state");
+		if (kp->data == 0)
+			VSL(SLT_Debug, 0,
+			    "KQR d %ju filter %d data %jd flags 0x%x idle %g",
+			    kp->ident, kp->filter, kp->data, kp->flags,
+			    sp->idle - idle);
+		Wait_Handle(vwk->waiter, sp, WAITER_ACTION, now);
 	}
 }
 



More information about the varnish-commit mailing list