mirror of
https://github.com/python/cpython.git
synced 2025-10-05 22:51:56 +00:00
[3.6] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc (GH-1683) (#1815)
* 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
)
This commit is contained in:
parent
f43b293f2f
commit
2783cc4262
3 changed files with 27 additions and 12 deletions
|
@ -752,6 +752,20 @@ class _TestQueue(BaseTestCase):
|
|||
# Windows (usually 15.6 ms)
|
||||
self.assertGreaterEqual(delta, 0.170)
|
||||
|
||||
def test_queue_feeder_donot_stop_onexc(self):
|
||||
# bpo-30414: verify feeder handles exceptions correctly
|
||||
if self.TYPE != 'processes':
|
||||
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||
|
||||
class NotSerializable(object):
|
||||
def __reduce__(self):
|
||||
raise AttributeError
|
||||
with test.support.captured_stderr():
|
||||
q = self.Queue()
|
||||
q.put(NotSerializable())
|
||||
q.put(True)
|
||||
self.assertTrue(q.get(timeout=0.1))
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue