summaryrefslogtreecommitdiff
path: root/Lib/multiprocessing
Commit message (Collapse)AuthorAgeFilesLines
* [3.7] bpo-36766: Typos in docs and code comments (GH-13116). (GH-13136)penguindustin2019-05-061-1/+1
| | | | | | | | | | | (cherry picked from commit 964663089547ca110199e23867b46b07ff4be88c) Co-authored-by: penguindustin <penguindustin@gmail.com> https://bugs.python.org/issue36766
* [3.7] bpo-36492: Fix passing special keyword arguments to some functions. ↵Serhiy Storchaka2019-04-011-2/+25
| | | | | | | | | | | | | | | | | | | | | | | (GH-12637) (GH-12645) The following arguments can be passed as keyword arguments for passing to other function if the corresponding required argument is passed as positional: - "func" in functools.partialmethod(), weakref.finalize(), profile.Profile.runcall(), cProfile.Profile.runcall(), bdb.Bdb.runcall(), trace.Trace.runfunc() and curses.wrapper(). - "function" in unittest.addModuleCleanup() and unittest.TestCase.addCleanup(). - "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor and concurrent.futures.ProcessPoolExecutor. - "callback" in contextlib.ExitStack.callback(), contextlib.AsyncExitStack.callback() and contextlib.AsyncExitStack.push_async_callback(). - "c" and "typeid" in multiprocessing.managers.Server.create(). - "obj" in weakref.finalize(). (cherry picked from commit 42a139ed88c487f325a241c6ee8b308b3c045975)
* bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824)Miss Islington (bot)2019-02-111-1/+1
| | | | | (cherry picked from commit a31f4cc881992e84d351957bd9ac1a92f882fa39) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* bpo-35872 and bpo-35873: Clears __PYVENV_LAUNCHER__ variable (GH-11745)Steve Dower2019-02-042-9/+26
| | | | After reading __PYVENV_LAUNCHER__ we now set sys._base_executable value for later use. Make the same changes for macOS to avoid extra platform checks.
* bpo-35797: Fix default executable used by the multiprocessing module (GH-11676)Miss Islington (bot)2019-01-251-1/+8
| | | | | (cherry picked from commit 4e02f8f8b4baab63f927cfd87b401200ba2969e9) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* [3.7] Revert "bpo-34172: multiprocessing.Pool leaks resources after being ↵Victor Stinner2018-12-061-50/+24
| | | | | | deleted (GH-8450) (GH-9676)" (#10968) This reverts commit 97f998a4dfd6db6d867f446daa62445d0782bf39.
* bpo-34172: multiprocessing.Pool leaks resources after being deleted ↵Miss Islington (bot)2018-10-021-24/+50
| | | | | | | | (GH-8450) (GH-9676) Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly. (cherry picked from commit 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0) Co-authored-by: tzickel <tzickel@users.noreply.github.com>
* bpo-34521: Fix tests in test_multiprocessing_spawn to use correctly ↵Miss Islington (bot)2018-09-281-1/+1
| | | | | | | | | | | | | | | | | | | CMSG_SPACE (GH-9613) (GH-9619) After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots regarding tests in test_multiprocessing_spawn and after examining similar failures in test_socket, some errors in the calculation of ancillary data buffers were found in multiprocessing.reduction. CMSG_LEN() can often be used as the buffer size for recvmsg() to receive a single item of ancillary data, but RFC 3542 requires portable applications to use CMSG_SPACE() and thus include space for padding, even when the item will be the last in the buffer. The failures we experience are due to the usage of CMSG_LEN() instead of CMSG_SPACE(). (cherry picked from commit 077061a7b24917aaf31057885c69919c5a553c88) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113)Miss Islington (bot)2018-09-171-1/+4
| | | | | (cherry picked from commit e0e5065daef36dafe10a46eaa8b7800274d73062) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-34054: multiprocessing uses time.monotonic() (GH-8118)Miss Islington (bot)2018-07-064-13/+12
| | | | | | | | The multiprocessing module now uses the monotonic clock time.monotonic() instead of the system clock time.time() to implement timeouts. (cherry picked from commit c2368cbc83ca2bafeaea0e4760be4996046d0444) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* Revert "bpo-33929: multiprocessing: fix handle leak on race condition ↵Victor Stinner2018-06-273-29/+6
| | | | | (GH-7921)" (GH-7963) This reverts commit 8b1ebcd7cb3319273ea635df78ebf9ad40171514.
* bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)Miss Islington (bot)2018-06-273-6/+29
| | | | | | | | | | | | Fix a race condition in Popen of multiprocessing.popen_spawn_win32. The child process now duplicates the read end of pipe instead of "stealing" it. Previously, the read end of pipe was "stolen" by the child process, but it leaked a handle if the child process had been terminated before it could steal the handle from the parent process. (cherry picked from commit 2cc9d21fffb8146d30e6fb4221e32410ba4b4ab7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33078 - Fix queue size on pickling error (GH-6119) (GH-6178)Miss Islington (bot)2018-03-211-2/+8
| | | | | (cherry picked from commit e2f33add635df4fde81be9960bab367e010c19bf) Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
* bpo-31804: Fix multiprocessing.Process with broken standard streams ↵Miss Islington (bot)2018-03-113-10/+16
| | | | | | | | | | (GH-6079) (GH-6080) 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. (cherry picked from commit e756f66c83786ee82f5f7d45931ae50a6931dd7f) Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* bpo-32576: use queue.SimpleQueue in critical places (#5216)Antoine Pitrou2018-01-181-8/+11
| | | | Where a queue may be invoked from a weakref callback, we need to use the reentrant SimpleQueue.
* bpo-31699 Deadlocks in `concurrent.futures.ProcessPoolExecutor` with ↵Thomas Moreau2018-01-051-5/+16
| | | | | | pickling error (#3895) Fix deadlocks in :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or results cause pickling or unpickling errors. This should make sure that calls to the :class:`ProcessPoolExecutor` API always eventually return.
* bpo-32157: Removed explicit quotes around %r and {!r}. (#4582)Serhiy Storchaka2017-11-281-2/+2
|
* bpo-31310: multiprocessing's semaphore tracker should be launched again if ↵Antoine Pitrou2017-11-031-3/+17
| | | | | | | | | | | crashed (#3247) * bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed * Avoid mucking with process state in test. Add a warning if the semaphore process died, as semaphores may then be leaked. * Add NEWS entry
* bpo-31308: If multiprocessing's forkserver dies, launch it again when ↵Antoine Pitrou2017-11-031-5/+16
| | | | | | | | | | | | | | | | | | | | | | necessary (#3246) * bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary. * Fix test on Windows * Add NEWS entry * Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker. * Fix comment * Make sure the test doesn't muck with process state * Also test previously-started processes * Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst * Avoid masking SIGTERM in forkserver. It's not necessary and causes a race condition in test_many_processes.
* bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed ↵Antoine Pitrou2017-10-221-2/+8
| | | | or None. (#4073)
* [Trivial] Remove now redundant assert (#3245)Antoine Pitrou2017-08-301-1/+0
|
* bpo-5001: More-informative multiprocessing error messages (#3079)Allen W. Smith, Ph.D2017-08-3014-39/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make error message more informative Replace assertions in error-reporting code with more-informative version that doesn't cause confusion over where and what the error is. * Additional clarification + get travis to check * Change from SystemError to TypeError As suggested in PR comment by @pitrou, changing from SystemError; TypeError appears appropriate. * NEWS file installation; ACKS addition (will do my best to justify it by additional work) * Making current AssertionErrors in multiprocessing more informative * Blurb added re multiprocessing managers.py, queues.py cleanup * Further multiprocessing cleanup - went through pool.py * Fix two asserts in multiprocessing/util.py * Most asserts in multiprocessing more informative * Didn't save right version * Further work on multiprocessing error messages * Correct typo * Correct typo v2 * Blasted colon... serves me right for trying to work on two things at once * Simplify NEWS entry * Update 2017-08-18-17-16-38.bpo-5001.gwnthq.rst * Update 2017-08-18-17-16-38.bpo-5001.gwnthq.rst OK, never mind. * Corrected (thanks to pitrou) error messages for notify * Remove extraneous backslash in docstring.
* 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-5001, bpo-31169: Fix two uninformative asserts in ↵Allen W. Smith, Ph.D2017-08-121-7/+10
| | | | | | | | | | | | | | | | multiprocessing/managers.py (#3078) * Make error message more informative Replace assertions in error-reporting code with more-informative version that doesn't cause confusion over where and what the error is. * Additional clarification + get travis to check * Change from SystemError to TypeError As suggested in PR comment by @pitrou, changing from SystemError; TypeError appears appropriate. * NEWS file installation; ACKS addition (will do my best to justify it by additional work)
* 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-30919: shared memory allocation performance regression in ↵Antoine Pitrou2017-07-231-10/+16
| | | | | | | | | | multiprocessing (#2708) * Fix #30919: shared memory allocation performance regression in multiprocessing * Change strategy for Arena directory choice * Add blurb
* bpo-26732: fix too many fds in processes started with the "forkserver" ↵Antoine Pitrou2017-07-221-1/+4
| | | | | | | | | | method (#2813) * bpo-26732: fix too many fds in processes started with the "forkserver" method A child process would inherit as many fds as the number of still-running children. * Add blurb and test comment
* bpo-19896: Add typecodes 'q' and 'Q' to multiprocessing.sharedctypes (#2741)Gareth Rees2017-07-211-6/+7
| | | | | | | | | | * bpo-19896: Add typcodes 'q' and 'Q' to multiprocessing.sharedctypes. Patch by Antony Lee. * Add NEWS entry. * Slightly tweak NEWS entry Make it clear this is more of a fix rather than a new feature.
* bpo-30794: added kill() method to multiprocessing.Process (#2528)Vitor Pereira2017-07-183-2/+17
| | | | | | | | | | | | | | * 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
* bpo-30886: Fix multiprocessing.Queue.join_thread() (#2642)Victor Stinner2017-07-101-8/+1
| | | | | | | | | | multiprocessing.Queue.join_thread() now waits until the thread completes, even if the thread was started by the same process which created the queue. Fix the following warning which occurs randomly when running test_handle_called_with_mp_queue of test_logging.QueueListenerTest: Warning -- threading_cleanup() failed to cleanup -1 threads after 4 sec (count: 0, dangling: 1)
* bpo-29293: multiprocessing.Condition.notify() lacks parameter `n` (#2480)Antoine Pitrou2017-07-042-21/+7
| | | | | | * bpo-29293: multiprocessing.Condition.notify() lacks parameter `n` * Add NEWS blurb
* 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-246-8/+59
| | | | | | | | | | * 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-24484: Avoid race condition in multiprocessing cleanup (#2159)Antoine Pitrou2017-06-131-13/+21
| | | | | | | | | | | * bpo-24484: Avoid race condition in multiprocessing cleanup The finalizer registry can be mutated while inspected by multiprocessing at process exit. * Use test.support.start_threads() * Add Misc/NEWS
* bpo-30643: Fix race condition in signal wakeup in forkserver (followup to PR ↵Antoine Pitrou2017-06-131-4/+8
| | | | | | | | | | | | | #1989) (#2139) * Fix race condition in signal wakeup in forkserver (followup to PR #1989) There's an admittedly well-known race condition where ECHILD can arrive just before the C function epoll_wait() and the latter wouldn't therefore return EINTR. The solution is to use set_wakeup_fd(), which was designed to avoid such race conditions. * Reset wakeup fd in child
* Fix bpo-30589: improve Process.exitcode with forkserver (#1989)Antoine Pitrou2017-06-123-47/+97
| | | | | | | | * Fix bpo-30589: improve Process.exitcode with forkserver When the child is killed, Process.exitcode should return -signum, not 255. * Add Misc/NEWS
* bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027)Victor Stinner2017-06-101-1/+1
| | | | | | | multiprocessing.Queue.get() with a timeout now polls its reader in non-blocking mode if it succeeded to aquire the lock but the acquire took longer than the timeout. Co-Authored-By: Grzegorz Grzywacz <grzgrzgrz3@gmail.com>
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-272-8/+0
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc ↵grzgrzgrz32017-05-251-12/+10
| | | | | | | | | | | | | | | | | | (#1683) * bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc Queue background running thread was not handling exceptions correctly. Any exception occurred inside thread (putting unpickable object) cause feeder to finish running. After that every message put into queue is silently ignored. * bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc Queue background running thread was not handling exceptions correctly. Any exception occurred inside thread (putting unpickable object) cause feeder to finish running. After that every message put into queue is silently ignored.
* bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)Jon Dufresne2017-05-183-4/+3
| | | | | | | | * Replaced list(<generator expression>) with list comprehension * Replaced dict(<generator expression>) with dict comprehension * Replaced set(<list literal>) with set literal * Replaced builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max())
* bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601)Xiang Zhang2017-05-171-0/+1
| | | | | Under *spawn* and *forkserver* start methods, SimpleQueue.empty() could raise AttributeError due to not setting _poll in __setstate__.
* bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319)Antoine Pitrou2017-05-041-6/+14
| | | | | | * bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver * Tweak comment
* bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110)Serhiy Storchaka2017-04-191-1/+1
|
* bpo-29762: More use "raise from None". (#569)Serhiy Storchaka2017-04-053-5/+5
| | | This hides unwanted implementation details from tracebacks.
* bpo-28699: fix abnormal behaviour of pools in multiprocessing.pool (GH-693)Xiang Zhang2017-03-291-24/+55
| | | | | an exception raised at the very first of an iterable would cause pools behave abnormally (swallow the exception or hang)
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+1
| | | Make also minor PEP8 coding style fixes on modified imports.
* bpo-29861: release references to multiprocessing Pool tasks (#743)Antoine Pitrou2017-03-241-1/+6
| | | | | | | | | | * bpo-29861: release references to multiprocessing Pool tasks Release references to tasks, their arguments and their results as soon as they are finished, instead of keeping them alive until another task arrives. * Comments in test
* bpo-29776: Use decorator syntax for properties. (#585)Serhiy Storchaka2017-03-194-7/+20
|
* Issue #28779: multiprocessing.set_forkserver_preload() would crash the ↵Antoine Pitrou2016-12-102-2/+2
|\ | | | | | | forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
| * Issue #28779: multiprocessing.set_forkserver_preload() would crash the ↵Antoine Pitrou2016-12-102-2/+2
| | | | | | | | forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.