From: phk Date: Tue, 20 Nov 2007 14:32:01 +0000 (+0000) Subject: Also accept deferred EBADF errors. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=911a88c32b2348692648bd7b9b6bd09aeb7afd26;p=varnish Also accept deferred EBADF errors. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2269 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c index 7621c944..128e7948 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c +++ b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c @@ -148,13 +148,17 @@ vca_kq_sess(struct sess *sp, short arm) assert(i <= 0); if (i < 0) { /* - * We do not push kevents into the kernel before passing the session off - * to a worker thread, so by the time we get around to delete the event - * the fd may be closed and we get an ENOENT back once we do flush. - * - * XXX: Can we get EBADF if the client closes during this window ? + * We do not push kevents into the kernel before + * passing the session off to a worker thread, so + * by the time we get around to delete the event + * the fd may be closed and we get an ENOENT back + * once we do flush. + * We can get EBADF the same way if the client closes + * on us. In that case, we get no kevent on that + * socket, but the TAILQ still has it, and it will + * be GC'ed there after the timeout. */ - assert(errno == ENOENT); + assert(errno == ENOENT || errno == EBADF); } nki = 0; }