summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/process.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-104536: Improve `multiprocessing.process._cleanup` logic ↵Miss Islington (bot)2023-05-221-1/+1
| | | | | | | | | | | | | (GH-104537) (#104737) Fix a race condition in the internal `multiprocessing.process` cleanup logic that could manifest as an unintended `AttributeError` when calling `BaseProcess.close()`. (cherry picked from commit ef5d00a59207a63c6d5ae0d5d44054847d1bf3b5) Co-authored-by: Luccccifer <lukezhang764@gmail.com> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-90549: Fix leak of global named resources using multiprocessing spawn ↵Miss Islington (bot)2022-06-101-2/+8
| | | | | | | | | (GH-30617) Co-authored-by: XD Trol <milestonejxd@gmail.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr> (cherry picked from commit 30610d28374f5a9698d456cebf3ae496ac01af51) Co-authored-by: Leo Trol <milestone.jxd@gmail.com>
* bpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993)Nikita Sobolev2022-02-031-0/+1
|
* bpo-35727: Use exit code 0 on sys.exit() in multiprocessing.Process. (GH-11538)Christopher Hunt2020-02-211-5/+5
|
* bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088)Jake Tesler2019-11-191-0/+2
| | | | | | | | | | | | | | | | | | | This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`. In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own). This change forces the Process object to update its `native_id` attribute during the bootstrap process. cc @vstinner https://bugs.python.org/issue38707 Automerge-Triggered-By: @pitrou
* bpo-36888: Add multiprocessing.parent_process() (GH-13247)Thomas Moreau2019-05-201-3/+49
|
* bpo-35491: Enhance multiprocessing.BaseProcess.__repr__() (GH-11138)Victor Stinner2018-12-141-11/+16
| | | | | | | | | | | | | | | | * Add the pid and parent pid to multiprocessing.BaseProcess.__repr__(). * Add negative sign (ex: "-SIGTERM") to exitcode (process killed by a signal) * Only call _popen.poll() once. Example: <ForkProcess(ForkPoolWorker-1, started daemon)> becomes: <ForkProcess name='ForkPoolWorker-1' pid=12449 parent=12448 started daemon> Example: <ForkProcess(ForkPoolWorker-1, stopped[SIGTERM] daemon)> becomes: <ForkProcess name='ForkPoolWorker-1' pid=12960 parent=12959 stopped exitcode=-SIGTERM daemon>
* bpo-31804: Fix multiprocessing.Process with broken standard streams (#6079)Antoine Pitrou2018-03-111-2/+1
| | | | | In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows). Avoid failing with a non-0 exit code in those conditions. Report and initial patch by poxthegreat.
* bpo-18966: non-daemonic threads created by a multiprocessing.Process should ↵Antoine Pitrou2017-08-161-0/+2
| | | | | | | | be joined on exit (#3111) * bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit * Add NEWS blurb
* bpo-31019: Fix multiprocessing.Process.is_alive() (#2875)Victor Stinner2017-07-261-2/+8
| | | | | | multiprocessing.Process.is_alive() now removes the process from the _children set if the process completed. The change prevents leaking "dangling" processes.
* bpo-30794: added kill() method to multiprocessing.Process (#2528)Vitor Pereira2017-07-181-0/+7
| | | | | | | | | | | | | | * bpo-30794: added kill() method to multiprocessing.Process * Added entries to documentation and NEWS * Refactored test_terminate and test_kill * Fix SIGTERM and SIGKILL being used on Windows for the tests * Added "versionadded" marker to the documentation * Fix trailing whitespace in doc
* Clear potential ref cycle between Process and Process target (#2470)Antoine Pitrou2017-06-281-0/+3
| | | | | | | | | * 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
* Fix bpo-30596: Add close() method to multiprocessing.Process (#2010)Antoine Pitrou2017-06-241-0/+35
| | | | | | | | | | * Fix bpo-30596: Add close() method to multiprocessing.Process * Raise ValueError if close() is called before the Process is finished running * Add docs * Add NEWS blurb
* bpo-29762: More use "raise from None". (#569)Serhiy Storchaka2017-04-051-1/+1
| | | This hides unwanted implementation details from tracebacks.
* 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 ........