We are running a Django-driven site using Apache. Some of our forms launch a
time-consuming process by using Popen:

   p = subprocess.Popen(my_cmd, shell=True)

which works fine, in the sense that the command gets launched in the
background and doesn't hang the website while it processes.

These processes, though, don't terminate properly. Instead, I see an
ever-growing list of processes using 'ps -A' that look like

   15576 ?        00:00:00 my_cmd <defunct>
   15962 ?        00:00:00 my_cmd <defunct>
   16014 ?        00:00:00 my_cmd <defunct>
   ...

I get another of these each time I submit a form, and they never go away
until I restart Apache.

This seems to be a common problem with Python. All the remedies, however,
suggest calling some form of wait() on the process to ensure that it has
completed. In our case, this isn't an option, because we don't want to make
Apache wait on what ought to be a reasonably quick form submission.

How can I avoid this problem, or otherwise deal with the resulting zombies?
-- 
View this message in context: 
http://old.nabble.com/Defunct-Processes-on-Server-tp32249402p32249402.html
Sent from the django-users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to