Skip to content

[3.6] bpo-26762, bpo-31019: Backport multiprocessing fixes from master to 3.6 #2879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 26, 2017
Merged

[3.6] bpo-26762, bpo-31019: Backport multiprocessing fixes from master to 3.6 #2879

merged 5 commits into from
Jul 26, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jul 26, 2017

vstinner added 5 commits July 26, 2017 04:23
test_level() of _test_multiprocessing._TestLogging now uses regular
processes rather than daemon processes to prevent zombi processes
(to not "leak" processes).
(cherry picked from commit 0663495)
bpo-26762: Fix more dangling processes and threads in
test_multiprocessing:

* Queue: call close() followed by join_thread()
* Process: call join() or self.addCleanup(p.join)
(cherry picked from commit d7e64d9)
bpo-26762: test_multiprocessing now detects dangling processes and
threads per test case classes:

* setUpClass()/tearDownClass() of mixin classes now check if
  multiprocessing.process._dangling or threading._dangling was
  modified to detect "dangling" processses and threads.
* ManagerMixin.tearDownClass() now also emits a warning if it still
  has more than one active child process after 5 seconds.
* tearDownModule() now checks for dangling processes and threads
  before sleep 500 ms. And it now only sleeps if there is a least one
  dangling process or thread.
(cherry picked from commit ffb4940)
* Close explicitly queues to make sure that we don't leave dangling
  threads
* test_queue_in_process(): remove unused queue
* test_access() joins also the process to fix a random warning
(cherry picked from commit b4c5296)
multiprocessing.Process.is_alive() now removes the process from the
_children set if the process completed.

The change prevents leaking "dangling" processes.
(cherry picked from commit 2db6482)
@vstinner vstinner changed the title bpo-26762, bpo-31019: Backport multiprocessing fixes from master to 3.6 [3.6] bpo-26762, bpo-31019: Backport multiprocessing fixes from master to 3.6 Jul 26, 2017
@vstinner vstinner merged commit d0adfb2 into python:3.6 Jul 26, 2017
@vstinner vstinner deleted the multiprocessing36 branch July 26, 2017 02:48
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.

2 participants