[master] 9254b12 OS/X's kqueue can return zero events.
Poul-Henning Kamp
phk at varnish-cache.org
Wed Nov 13 09:33:05 CET 2013
commit 9254b1281b71f773ac028392eca21d5def912d49
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Nov 13 08:32:47 2013 +0000
OS/X's kqueue can return zero events.
diff --git a/bin/varnishd/waiter/cache_waiter_kqueue.c b/bin/varnishd/waiter/cache_waiter_kqueue.c
index ce9beb7..fb82e99 100644
--- a/bin/varnishd/waiter/cache_waiter_kqueue.c
+++ b/bin/varnishd/waiter/cache_waiter_kqueue.c
@@ -170,7 +170,12 @@ vwk_thread(void *priv)
dotimer = 0;
n = kevent(vwk->kq, vwk->ki, vwk->nki, ke, NKEV, NULL);
now = VTIM_real();
- assert(n >= 1 && n <= NKEV);
+ assert(n <= NKEV);
+ if (n == 0) {
+ /* This happens on OSX in m00011.vtc */
+ dotimer = 1;
+ (void)usleep(10000);
+ }
vwk->nki = 0;
for (kp = ke, j = 0; j < n; j++, kp++) {
if (kp->filter == EVFILT_TIMER) {
More information about the varnish-commit
mailing list