From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 22:52:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799FD106564A; Sun, 28 Mar 2010 22:52:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 543778FC1E; Sun, 28 Mar 2010 22:52:24 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 05D3C46B46; Sun, 28 Mar 2010 18:52:24 -0400 (EDT) Date: Sun, 28 Mar 2010 23:52:23 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jilles Tjoelker In-Reply-To: <20100328210630.GA2086@stack.nl> Message-ID: References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> <20100328210630.GA2086@stack.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 22:52:24 -0000 On Sun, 28 Mar 2010, Jilles Tjoelker wrote: > On Sun, Mar 28, 2010 at 01:28:42PM -0700, Doug Barton wrote: >> Probably my fault for not saying something sooner, but there is a problem >> with the code in head that sometimes causes it to loop repeatedly even >> though pwait exits successfully. I am trying to track it down, but since it >> only happens about once every 10 shutdowns it's been difficult. > > There is a difference between the two methods in what is waited for exactly. > pwait(1) will wait for the process to terminate; if it is applied to a > zombie it will return immediately (printing the exit status if -v was > given). On the other hand, kill(1) will continue to return success until the > process has been waited for by its parent. > > An obvious fix is to trust pwait if it returns successfully, e.g. like if > pwait $_list 2>/dev/null; then break; else sleep 2; fi I noticed last year that Apple has implemented a separate PROC_REAP event in kqueue -- it would be easy for us to implement that as well, and add a flag to pwait to allow the user to decide to use that semantic instead (if desired). Robert N M Watson Computer Laboratory University of Cambridge