2
Apache/2.2.6 (Unix) DAV/2 mod_python/3.2.8 Python/2.4.4 configured ...

One of apache processes spawns some long-running python script asynchronously, and apparently doesn't seem to collect its child process table entry. After that long-run-in-subprocess python script finishes - defunct python process has been left.

# ps -ef | grep httpd
root     23911     1  0 Oct15 ?        00:00:01 /usr/sbin/httpd
...
qa       23920 23911  0 Oct15 ?        00:00:00 /usr/sbin/httpd


# ps -ef | grep python
...
qa       28449 23920  0 12:38 ?        00:00:00 [python] <defunct>

What is the way to make the Apache process to collect its children? Is it possible to do the job via a mod_python request handler ( like PythonCleanupHandler for example)?

Thanks.

victorz
  • 2,209
  • 4
  • 19
  • 15

2 Answers2

1

File a bug report.

EDIT: I'm serious. Leaving zombies behind is a bug, and there is almost certainly nothing you can do from within Python.

Upgrade to the latest versions, look for bug reports, post on the mailing list, switch to another product.

1

Drop mod_python in favor of mod_wsgi (is used for wsgi), which does not leave orphaned zombies around afaik.

Florian Bösch
  • 27,420
  • 11
  • 48
  • 53
  • i plan on doing this in the future, however if possible I would like to put a band-aid on this problem. is there a quick hack to this? My apache server keeps going down overnight! – JiminyCricket Mar 08 '11 at 14:36