Skip to content

[3.6] bpo-31249: Fix ref cycle in ThreadPoolExecutor#3253

Merged
vstinner merged 2 commits into
python:3.6from
vstinner:concurrent36
Sep 1, 2017
Merged

[3.6] bpo-31249: Fix ref cycle in ThreadPoolExecutor#3253
vstinner merged 2 commits into
python:3.6from
vstinner:concurrent36

Conversation

@vstinner

@vstinner vstinner commented Aug 31, 2017

Copy link
Copy Markdown
Member

test_concurrent_futures checks also dangling threads.

https://bugs.python.org/issue31249

Add a BaseTestCase class to test_concurrent_futures to check for
dangling threads and processes on all tests, not only tests using
ExecutorMixin.

(cherry picked from commit 489d91c)
* bpo-31249: Fix ref cycle in ThreadPoolExecutor

concurrent.futures: WorkItem.run() used by ThreadPoolExecutor now
breaks a reference cycle between an exception object and the WorkItem
object. ThreadPoolExecutor.shutdown() now also clears its threads
set.

* shutdown() now only clears threads if wait is true.

* Revert changes on shutdown()

(cherry picked from commit bc61315)
@vstinner vstinner changed the title bpo-31249: Fix ref cycle in ThreadPoolExecutor [3.6] bpo-31249: Fix ref cycle in ThreadPoolExecutor Sep 1, 2017
@vstinner vstinner merged commit 60f3f1f into python:3.6 Sep 1, 2017
@vstinner vstinner deleted the concurrent36 branch September 1, 2017 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants