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.

作者 jnoller
收信人 asksol, gdb, jnoller
日期 2010-07-12.21:03:56
SpamBayes Score 0.02920633
Marked as misclassified
Message-id <1278968639.69.0.177194012404.issue9205@psf.upfronthosting.co.za>
In-reply-to
内容
Greg - I asked Ask to take a look - his celery package is a huge consumer of multiprocessing, and so I tend to run things past him as well. 

That said - to both of you - the fundamental problem the shutdown patch is trying to scratch is located in issue 9207 - greg's termination patch just exposes the problem in 9207 a lot more.

Focusing specifically on the shutdown patch; our issue is that during interpreter shutdown, sys.modules is iterated, and entries are set to None - for threads which "live on" well into that cycle can end up losing imported functions/modules/etc. The multiple daemon threads in the Pool code are exposing this as code which executed imported functions (such as the debug() statement in handle_workers) which will fire after the pool has exited and the interpreter is shut down.

We can work around the shutdown issue (really, bug 9207) by ignoring the exception such as shutdown.patch does, or passing in references/adding references to the functions those methods need. Or (as Brett suggested) converting them to class methods and adding references to the class. Or passing them in via the signature like this _handle_workers(arg, _debug=debug), etc.
历史
日期 用户 动作 参数
2010-07-12 21:04:00jnoller修改recipients: + jnoller, asksol, gdb
2010-07-12 21:03:59jnoller修改messageid: <1278968639.69.0.177194012404.issue9205@psf.upfronthosting.co.za>
2010-07-12 21:03:57jnoller链接issue9205 messages
2010-07-12 21:03:56jnoller创建