deadloop in zdrun.py leaves parent process hung
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Medium
|
Unassigned |
Bug Description
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.
Changed in zope2: | |
status: | New → Confirmed |
PATCH: stable/ lib/python/ zdaemon/ zdrun.py 2006-07-07 15:00:13.246377264 +1200 zope-stable/ lib/python/ zdaemon/ zdrun.py 2006-07-07 13:59:46.502932790 +1200
if self.killing and self.proc.pid:
self. proc.kill( signal. SIGKILL)
self. delay = time.time() + self.options. backofflimit setstatus( 0)
--- app/zope-
+++ /u01/app/
@@ -421,6 +421,7 @@
+ self.proc.
try:
r, w, x = select.select(r, w, x, timeout)
except select.error, err: