[ZCM] [ZC] 2142/ 1 Request "deadloop in zdrun.py leaves parent process hung"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Thu Jul 6 22:24:30 EDT 2006


Issue #2142 Update (Request) "deadloop in zdrun.py leaves parent process hung"
 Status Pending, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/2142

==============================================================
= Request - Entry #1 by esrever_otua on Jul 6, 2006 10:24 pm

Under certain conditions, the runforever() function in zdrun.py will deadloop attempting to kill.SIGKILL a defunct child process (which will never suceed).  It can be triggered by starting and stopping a zope instance from code running in another zope instance (both instances running as the same unprivileged user account) with the 'zopectl start' and 'zopectl stop' commands.
Sample workflow:
Have two zope instances.
Have code in one instance that executes a shell command to start, then executes another shell command to stop the other instance.
The stop command will fail - the child processes are left as 'defunct' and the parent will loop forever sending KILL commands to them (which will obviously not succeed).

Suggested fix: set the child pid to '0' with self.proc.setstatus(0) immediately after sending the SIGKILL (the only conditions under which SIGKILL will not remove the process from the process table is when it is a zombie, as per above).  This correctly fixes the problem (tested OK).

==============================================================



More information about the Zope-Collector-Monitor mailing list