Date: Mon, 29 Mar 2010 19:32:14 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: Doug Barton <dougb@FreeBSD.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc Message-ID: <20100329173214.GA17249@stack.nl> In-Reply-To: <4BAFE1EE.9040908@FreeBSD.org> References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> <20100328210630.GA2086@stack.nl> <4BAFE1EE.9040908@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 28, 2010 at 04:10:38PM -0700, Doug Barton wrote: > On 03/28/10 14:06, 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. > The process that I see this with most often is devd, does that fit the > model you're describing? Possibly. This would mainly happen because init has been busy, I think (or if the parent isn't init). > What are the implications of moving on after a > successful pwait even though there is still a zombie process? For shutdown/stop, nothing. For restart, there may be problems if a restarted daemon checks the validity of the pid in the pidfile using kill(). > > 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 > It can't be break, the point of the loop is that wait_for_pids() takes a > list. We may be able to use continue however. pwait with a list waits until all of the processes have terminated. -- Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100329173214.GA17249>