[Python-Dev] cpython: Fix closes issue #11109 - socketserver.ForkingMixIn leaves zombies, also fails
neologix at free.fr
Wed May 25 23:00:51 CEST 2011
>> A new method called service_action is made available in BaseServer, called by
>> serve_forever loop. This useful in cases where Mixins can use it for cleanup
>> action. ForkingMixin class uses service_action to collect the zombie child
>> processes. Initial Patch by Justin Wark.
> Is it reasonable, performance-wise, to do this at every iteration of
> the loop (that is, at every incoming connection)?
I haven't measured it, but it's O(N) where N is the number of children.
It should be possible to optimize this by putting all the children in
a process group (the other advantage is that we wouldn't wait()
children not spawned by socketserver).
More information about the Python-Dev