svn commit: r205806 - stable/8/etc

Robert Watson rwatson at FreeBSD.org
Sun Mar 28 22:52:24 UTC 2010


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


More information about the svn-src-stable-8 mailing list