Commit Graph

108 Commits

Author SHA1 Message Date
tzickel 4a7dd30f58 [2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686)
Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
2018-10-03 13:50:04 +02:00
Serhiy Storchaka 69d0bc1430
[2.7] bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113). (GH-9500)
(cherry picked from commit e0e5065dae)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-09-22 21:34:16 +03:00
Victor Stinner b65cb8a356 bpo-31019: Fix multiprocessing.Process.is_alive() (#2875) (#2882)
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 2db64823c2)
2017-07-26 17:54:42 +02:00
Victor Stinner ec9a7127b8 [3.6] bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027) (#2881) (#2883)
* bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027)

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>
(cherry picked from commit 1b7863c3b6)

* bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148)

_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.
(cherry picked from commit 8f6eeaf21c)

(cherry picked from commit e42339d3a0)
2017-07-26 17:52:36 +02:00
Antoine Pitrou 12536bd261 [2.7] Clear potential ref cycle between Process and Process target (GH-2470) (#2473)
* 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 79d37ae979)
2017-06-28 13:48:38 +02:00
Antoine Pitrou d09f1674d7 [2.7] bpo-24484: Avoid race condition in multiprocessing cleanup (GH-2159) (#2168)
* 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.
(cherry picked from commit 1eb6c0074d)
2017-06-13 17:52:29 +02:00
Antoine Pitrou bdd964710d [2.7] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc (GH-1683) (#1817)
* 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..
(cherry picked from commit bc50f03db4)
2017-05-25 17:53:04 +02:00
Marc Schlaich c47c315812 bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167)
Patch by Davin with help from Marc.
2017-05-18 19:40:16 -05:00
Antoine Pitrou 5084ff7ddf bpo-29861: release references to multiprocessing Pool tasks (#743) (#803)
* bpo-29861: release references to multiprocessing Pool tasks (#743)

* 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

(cherry picked from commit 8988945cdc)

* Fix Misc/NEWS ?
2017-03-24 16:03:46 +01:00
Serhiy Storchaka 994f04dbf5 Issue #28998: More APIs now support longs as well as ints. 2016-12-27 15:09:36 +02:00
Davin Potts 280290adb8 Issue #21201: Improves readability of multiprocessing error message from server to client for certain exceptions 2016-09-08 13:07:13 -05:00
Serhiy Storchaka 9a118f1dc3 Issue #26778: Fixed "a/an/and" typos in code comment and documentation. 2016-04-17 09:37:36 +03:00
Nick Coghlan 2a6c2c9baa Close #10128: don't rerun __main__.py in multiprocessing
- backports issue #10845's mitigation of incompatibilities between
  the multiprocessing module and directory and zipfile execution
- Multiprocessing on Windows will now automatically skip rerunning top
  level __main__.py modules in spawned processes, rather than failing
  with AssertionError
2015-11-19 12:59:39 +10:00
Serhiy Storchaka 1aa2c0f073 Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
2015-04-10 13:24:10 +03:00
Serhiy Storchaka 7c26be5b18 Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now
handle exceptions raised by an iterator.  Patch by Alon Diamant and Davin
Potts.
2015-03-13 08:31:34 +02:00
Serhiy Storchaka 233e6988f4 Issue #22853: Fixed a deadlock when use multiprocessing.Queue at import time.
Patch by Florian Finkernagel and Davin Potts.
2015-03-06 22:17:25 +02:00
Serhiy Storchaka 7fe04f1dca Issue #21849: Fixed xmlrpclib serialization of non-ASCII unicode strings in
the multiprocessing module.
2015-02-13 15:08:36 +02:00
Serhiy Storchaka fc1ae6c673 Fixed bugs in reprs of CookieJar and multiprocessing.dummy.Value. 2014-07-22 11:11:01 +03:00
Benjamin Peterson e03d3fdd20 do not generate pipe names in the temporary dir 2014-04-14 12:24:37 -04:00
Richard Oudkerk e8a57b98ec Issue #14548: Make multiprocessing finalizers check pid before
running to cope with possibility of gc running just after fork.
(Backport from 3.x.)
2014-01-23 00:11:04 +00:00
Richard Oudkerk 3f8376eaa2 Fix handling of SystemExit and exit code. Patch by Brodie Rao. 2013-11-17 17:24:11 +00:00
Richard Oudkerk 21aad9792f Issue #19425 -- a pickling error should not cause pool to hang. 2013-10-28 23:02:22 +00:00
Ezio Melotti f5469cff1f #18705: fix a number of typos. Patch by Févry Thibault. 2013-08-17 15:43:51 +03:00
Richard Oudkerk c8ef9bc694 Issue #18455: multiprocessing should not retry connect() with same socket. 2013-07-15 18:37:48 +01:00
Richard Oudkerk 1e462fefd6 Issue #17261: Ensure multiprocessing's proxies use proper address. 2013-07-02 13:31:43 +01:00
Richard Oudkerk 41072db709 Issue #17097: Make multiprocessing ignore EINTR. 2013-07-01 18:45:28 +01:00
doko@ubuntu.com 9855249a9f - Fix typos in the multiprocessing module. 2013-05-15 16:54:16 +02:00
Richard Oudkerk a9b90a7ff5 Issue #17805: Add AsyncResult alias for ApplyResult 2013-05-06 12:04:28 +01:00
Richard Oudkerk 7bdd93c20e Issue #17555: Fix ForkAwareThreadLock so that size of after fork
registry does not grow exponentially with generation of process.
2013-04-17 19:15:52 +01:00
Kristján Valur Jónsson 8927e8f421 Issue #12098: multiprocessing on Windows now starts child processes
using the same sys.flags as the current process.
Backport from default branch.
2013-03-19 15:07:35 -07:00
Richard Oudkerk ba48264bce Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR. 2013-02-26 12:37:07 +00:00
Benjamin Peterson eff492f4b7 Issue #15881: Fixed atexit hook in multiprocessing. 2013-02-02 11:15:50 -05:00
Richard Oudkerk 7796b08664 Issue #10527: Remove dead code 2013-01-15 13:13:35 +00:00
Giampaolo Rodola' 049a378cd7 issue 10527: fix missing import 2013-01-03 02:53:28 +01:00
Giampaolo Rodola' cef2006eaf Fix issue 10527: make multiprocessing use poll() instead of select() if available. 2012-12-31 17:23:09 +01:00
Richard Oudkerk faee75c33a Issue #15646: Prevent equivalent of a fork bomb when using multiprocessing
on Windows without the "if __name__ == '__main__'" idiom.
2012-08-14 11:41:19 +01:00
Richard Oudkerk e4b9938d77 Issue #6056: Make multiprocessing use setblocking(True) on the sockets it uses.
Original patch by J Derek Wilson.
2012-07-27 14:05:46 +01:00
Richard Oudkerk 4215d2738a Issue #15101: Make pool finalizer avoid joining current thread 2012-06-18 15:37:31 +01:00
Richard Oudkerk 2182e0578c Issue #13854: Properly handle non-integer, non-string arg to SystemExit
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.
2012-06-06 19:01:14 +01:00
Richard Oudkerk d44a4a27a6 Issue #12157: pool.map() does not handle empty iterable correctly
Initial patch by mouad
2012-06-06 17:52:18 +01:00
Richard Oudkerk 6a942528ec Issue #14881: Allow normal non-main thread to spawn a dummy process
Fix suggested by Itay Brandes
2012-05-25 12:56:33 +01:00
Richard Oudkerk 9a16fa69dd Fix for issue 14725 for 2.7 branch 2012-05-05 20:41:08 +01:00
Richard Oudkerk 0c200c282b Issue #9400: Partial backport of fix for #9244
In multiprocessing, a pool worker process would die
if the result/error could not be pickled.  This could
cause pool methods to hang.

In 3.x this was fixed by 0aa8af79359d (which also added
an error_callback argument to some methods), but the fix
was not back ported.
2012-05-02 16:36:26 +01:00
Charles-François Natali 709aa35a7a Issue #8184: Fix a potential file descriptor leak when a
multiprocessing.Connection socket can't be bound.
2012-02-04 14:40:25 +01:00
Charles-François Natali b40827d379 Issue #13565: Increase multiprocessing's server socket backlog, to avoid
dropped connections in case of simultaneous connection requests.
2011-12-23 19:05:45 +01:00
Antoine Pitrou 6a570d6b9a Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
when called with a timeout.  Patch by Arnaud Ysmal.
2011-11-10 00:33:50 +01:00
Charles-François Natali 46f990e58c Issue #10332: multiprocessing: fix a race condition when a Pool is closed
before all tasks have completed.
2011-10-24 18:43:51 +02:00
Ezio Melotti 1e87da16ea Remove duplication. 2011-10-19 10:39:35 +03:00
Antoine Pitrou 77657e40fa Issue #4106: Fix occasional exceptions printed out by multiprocessing on interpreter shutdown.
This bug doesn't seem to exist on 3.2, where daemon threads are killed
before Py_Finalize() is entered.
2011-08-24 22:41:05 +02:00
Charles-François Natali 414d0faedc Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
the garbage collector while the Heap lock is held.
2011-07-02 13:56:19 +02:00