[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Edward Catmur
Edward Catmur added the comment: Suggested patch: https://bitbucket.org/ecatmur/cpython/compare/19096-multiprocessing-race..#diff Move the worker_handler.join() to immediately after setting the worker handler thread state to TERMINATE. This is a safe change as nothing in the moved-over code

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +sbt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Edward Catmur
New submission from Edward Catmur: There is a race condition in multiprocessing.Pool._terminate_pool that can result in workers being restarted during shutdown (process shutdown or pool.terminate()). worker_handler._state = TERMINATE# < race from here task_handler._stat