[Buildd-tools-devel] Bug#391319: Bug#391319: ping

Kees Cook kees at outflux.net
Wed May 23 20:24:59 UTC 2007


On Wed, May 23, 2007 at 08:38:15PM +0100, Roger Leigh wrote:
> I hope to get it in the next release.  I've been using it for a few
> months, and now that etch is released it can go in.

Excellent!  :)

> The one problem I would like to get fixed first, however, is the delay
> while killing processes, if there are no processes to kill.  This
> makes the typical case of running schroot or ending a session wait for
> a good few seconds.  I would like it to be ~instantaneous in the case
> no processes need killing.

This is already true.  If no proc items are found to kill, the function
immediately exits.

> I think the while loop needs some optimisation, such as checking if
> the process has terminated so that it can break out of the loop early.
> I think simply repeating the readlink inside the loop would be
> sufficient.  So instead of "while kill", so "while readlink", and then
> kill inside the loop.

I was trading off between a 100% CPU spin on readlink vs 1 second
granularity for each process that fails to immediately die.  As it is
written, if the process dies immediately, the "kill -0" will fail and no
waiting will be done.

> Another nice addition would be to print out which processes are being
> killed if in verbose mode.

Is this valuable?  By the time the user sees the warning, the process is
already dead.  Perhaps both the pid and the exe name?

Attached is an improved patch.

-- 
Kees Cook                                            @outflux.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: better.diff
Type: text/x-diff
Size: 1716 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20070523/a47b8411/attachment-0001.diff 


More information about the Buildd-tools-devel mailing list