This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gdb
Recipients asksol, gdb, jnoller
Date 2010-08-13.20:53:00
SpamBayes Score 8.573586e-12
Marked as misclassified No
Message-id <>
I'll take another stab at this.  In the attachment (assign-tasks.patch), I've combined a lot of the ideas presented on this issue, so thank you both for your input.  Anyway:

- The basic idea of the patch is to record the mapping of tasks to workers.  I've added a protocol between the parent process and the workers that allows this to happen without adding a race condition between recording the task and the child dying.
- If a child unexpectedly dies, the worker_handler pretends that all of the jobs currently assigned to it raised a RuntimeError.  (Multiple jobs can be assigned to a single worker if the result handler is being slow.)
- The guarantee I try to provide is that each job will be started at most once.  There is enough information to instead ensure that each job is run exactly once, but in general whether that's acceptable or useful is really only known at the application level.

Some notes:
- I haven't implemented this for approach for the ThreadPool yet.
- The test suite runs but occasionally hangs on shutting down the pool in Ask's tests in multiprocessing-trunk@82502-termination-trackjobs.patch.  My experiments seem to indicate this is due to a worker dying while holding a queue lock.  So I think a next step is to deal with workers dying while holding a queue lock, although this seems unlikely in practice.  I have some ideas as to how you could fix this, if we decide it's worth trying.

Anyway, please let me know what you think of this approach/sample implementation.  If we decide that this seems promising, I'd be happy to built it out further.
Date User Action Args
2010-08-13 20:53:15gdbsetrecipients: + gdb, jnoller, asksol
2010-08-13 20:53:15gdbsetmessageid: <>
2010-08-13 20:53:09gdblinkissue9205 messages
2010-08-13 20:53:08gdbcreate