mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
On finalize, don't try to join not started process.
This commit is contained in:
parent
faf175385d
commit
d034b32f57
1 changed files with 3 additions and 5 deletions
|
@ -447,12 +447,10 @@ class Pool(object):
|
||||||
if pool and hasattr(pool[0], 'terminate'):
|
if pool and hasattr(pool[0], 'terminate'):
|
||||||
debug('joining pool workers')
|
debug('joining pool workers')
|
||||||
for p in pool:
|
for p in pool:
|
||||||
p.join()
|
if p.is_alive():
|
||||||
for w in pool:
|
|
||||||
if w.exitcode is None:
|
|
||||||
# worker has not yet exited
|
# worker has not yet exited
|
||||||
debug('cleaning up worker %s' % w.pid)
|
debug('cleaning up worker %d' % p.pid)
|
||||||
w.join()
|
p.join()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Class whose instances are returned by `Pool.apply_async()`
|
# Class whose instances are returned by `Pool.apply_async()`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue