summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/process.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-26762, bpo-31019: Backport multiprocessing fixes from master to ↵Victor Stinner2017-07-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3.6 (#2879) * bpo-26762: Avoid daemon process in _test_multiprocessing (#2842) 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 06634950c553f8df83330ed468c11483b857b7dc) * test_multiprocessing: Fix dangling process/thread (#2850) 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 d7e64d9934d86aa6173229de5af5fe908662a33a) * test_multiprocessing detects dangling per test case (#2841) 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 ffb49408f0780ae80a553208aa133bc5bb3ba129) * bpo-26762: test_multiprocessing close more queues (#2855) * 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 b4c52966c810b5c5e088fceff403247f610b7d13) * bpo-31019: Fix multiprocessing.Process.is_alive() (#2875) 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 2db64823c20538a6cfc6033661fab5711d2d4585)
* [3.6] Clear potential ref cycle between Process and Process target (GH-2470) ↵Antoine Pitrou2017-06-281-0/+3
| | | | | | | | | | | (#2471) * Clear potential ref cycle between Process and Process target Besides Process.join() not being called, this was an indirect cause of bpo-30775. The threading module already does this. * Add issue reference. (cherry picked from commit 79d37ae979a65ada0b2ac820279ccc3b1cd41ba6)
* Issue #25654:Victor Stinner2016-03-251-6/+1
| | | | | | | | | * multiprocessing: open file with closefd=False to avoid ResourceWarning * _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a previous test forgot to remove TESTFN) * test_sys_exit(): remove TESTFN after each loop iteration Initial patch written by Serhiy Storchaka.
* Merge.Richard Oudkerk2013-11-171-1/+1
|\
| * Fix handling of SystemExit and exit code. Patch by Brodie Rao.Richard Oudkerk2013-11-171-1/+1
| |
* | Issue #19478: Make choice of semaphore prefix more flexible.Richard Oudkerk2013-11-021-2/+8
| |
* | Issue #18999: Make multiprocessing use context objects.Richard Oudkerk2013-10-161-11/+10
| | | | | | | | | | This allows different parts of a program to use different methods for starting processes without interfering with each other.
* | Issue #8713: Support alternative start methods in multiprocessing on Unix.Richard Oudkerk2013-08-141-30/+30
|/ | | | See http://hg.python.org/sandbox/sbt#spawn
* Merge fixes for #13854 and #12157.Richard Oudkerk2012-06-071-3/+3
|\
| * Issue #13854: Properly handle non-integer, non-string arg to SystemExitRichard Oudkerk2012-06-061-3/+3
| | | | | | | | | | Previously multiprocessing only expected int or str. It also wrongly used an exit code of 1 when the argument was a string instead of zero.
* | Mark multiprocessing files with "Licensed to PSF under a Contributor Agreement"Richard Oudkerk2012-04-301-26/+1
| | | | | | | | instead of BSD licence.
* | Issue #13812: When a multiprocessing Process child raises an exception, ↵Antoine Pitrou2012-01-271-3/+4
|\ \ | |/ | | | | flush stderr after printing the exception traceback.
| * Issue #13812: When a multiprocessing Process child raises an exception, ↵Antoine Pitrou2012-01-271-3/+4
| | | | | | | | flush stderr after printing the exception traceback.
* | Issue #12573: Add resource checks for dangling Thread and Process objects.Antoine Pitrou2011-07-151-0/+5
|\ \ | |/
| * Issue #12573: Add resource checks for dangling Thread and Process objects.Antoine Pitrou2011-07-151-0/+5
| |
* | (Merge 3.2) Issue #12310: finalize the old process after _run_after_forkers()Victor Stinner2011-06-171-2/+8
|\ \ | |/ | | | | | | | | | | | | | | multiprocessing: Process._bootstrap() keeps a reference to the old process to delay its finalization until after _run_after_forkers() as been executed. This change should fix a crash on Mac OS X Tiger when a lock is released after a fork. Patch written by Charles-François Nataliv and Antoine Pitrou.
| * Issue #12310: finalize the old process after _run_after_forkers()Victor Stinner2011-06-171-2/+8
| | | | | | | | | | | | | | | | | | multiprocessing: Process._bootstrap() keeps a reference to the old process to delay its finalization until after _run_after_forkers() as been executed. This change should fix a crash on Mac OS X Tiger when a lock is released after a fork. Patch written by Charles-François Nataliv and Antoine Pitrou.
* | Issue #12040: Expose a new attribute `sentinel` on instances ofAntoine Pitrou2011-06-061-0/+12
| | | | | | | | | | :class:`multiprocessing.Process`. Also, fix Process.join() to not use polling anymore, when given a timeout.
* | Issue #6064: Add a `daemon` keyword argument to the threading.ThreadAntoine Pitrou2011-02-251-2/+6
|/ | | | | | and multiprocessing.Process constructors in order to override the default behaviour of inheriting the daemonic property from the current thread/process.
* 9162: fix license in multiprocessing filesR. David Murray2010-12-141-1/+27
|
* Missing part from r78654Florent Xicluna2010-03-041-1/+1
|
* Merged revisions 73694,73708,73738 via svnmerge fromAlexandre Vassalotti2009-07-171-1/+2
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73694 | jesse.noller | 2009-06-29 14:24:26 -0400 (Mon, 29 Jun 2009) | 1 line Issue 5740: multiprocessing.connection.* authkey fixes ........ r73708 | jesse.noller | 2009-06-30 13:11:52 -0400 (Tue, 30 Jun 2009) | 1 line Resolves issues 5155, 5313, 5331 - bad file descriptor error with processes in processes ........ r73738 | r.david.murray | 2009-06-30 22:49:10 -0400 (Tue, 30 Jun 2009) | 2 lines Make punctuation prettier and break up run-on sentence. ........
* For some reason sys.stdin may be None on Windows, and makes ↵Amaury Forgeot d'Arc2008-08-201-4/+5
| | | | | | | | test_multiprocessing fail. Since we are closing the fileno anyway, the best is to skip this part. Now test_multiprocessing should pass on Windows.
* Merged revisions 65864 via svnmerge fromBenjamin Peterson2008-08-191-20/+19
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65864 | jesse.noller | 2008-08-19 14:06:19 -0500 (Tue, 19 Aug 2008) | 2 lines issue3352: clean up the multiprocessing API to remove many get_/set_ methods and convert them to properties. Update the docs and the examples included. ........
* Merged revisions 64517,64519 via svnmerge fromBenjamin Peterson2008-06-251-5/+0
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r64517 | benjamin.peterson | 2008-06-24 22:09:05 -0500 (Tue, 24 Jun 2008) | 1 line remove bytes alias in multiprocessing ........ r64519 | benjamin.peterson | 2008-06-25 07:39:05 -0500 (Wed, 25 Jun 2008) | 1 line use byte literals in multiprocessing ........
* Merged revisions 64104,64117 via svnmerge fromBenjamin Peterson2008-06-111-0/+302
svn+ssh://pythondev@svn.python.org/python/trunk ........ r64104 | benjamin.peterson | 2008-06-10 21:40:25 -0500 (Tue, 10 Jun 2008) | 2 lines add the multiprocessing package to fulfill PEP 371 ........ r64117 | benjamin.peterson | 2008-06-11 07:26:31 -0500 (Wed, 11 Jun 2008) | 2 lines fix import of multiprocessing by juggling imports ........