bpo-35378: Fix multiprocessing.Pool references (GH-11627)

Changes in this commit:

1. Use a _strong_ reference between the Pool and associated iterators
2. Rework PR #8450 to eliminate a cycle in the Pool.

There is no test in this commit because any test that automatically tests this behaviour needs to eliminate the pool before joining the pool to check that the pool object is garbaged collected/does not hang. But doing this will potentially leak threads and processes (see https://bugs.python.org/issue35413).
This commit is contained in:
Pablo Galindo 2019-02-11 17:29:00 +00:00 committed by GitHub
parent 4b250fc1da
commit 3766f18c52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 39 deletions

View file

@ -2593,7 +2593,6 @@ class _TestPool(BaseTestCase):
pool = None
support.gc_collect()
def raising():
raise KeyError("key")