ProcessPool spawns more and more processes

Bug #579600 reported by Jean-Paul Calderone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ampoule
New
Undecided
Unassigned

Bug Description

It seems that under certain circumstances, if a worker process exits abnormally, ProcessPool will spawn *two* new processes to replace it. This ignores the maximum worker limit the ProcessPool is configured with, so eventually enough processes will be spawned so as to consume all available system resources.

I don't completely understand why this happens, but I know that the "second" replacement process is spawned by the `startAWorker` call attached to the `stopAWorker` Deferred in `_cb_doWork`. This may be because the `Shutdown` call issued by `stopAWorker` fails with `ProcessTerminated`. This results in the Deferred succeeding instead of failing, allowing the `startAWorker` callback to run. Additionally, when the process exits, it gets restarted by the logic in `_addProcess`. Just a guess, though.

(In general I think all this code should (and could be) be a lot simpler.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.