summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-05-25 15:19:10 (GMT)
committerGitHub <noreply@github.com>2017-05-25 15:19:10 (GMT)
commit89004d761361332314beb08b443bff5b092ec36e (patch)
tree26478d95d3d5c9dfdc0c5751637485b9fb309b4c /Lib/test
parentaa27f0e94f4d9c5ef589984dc2b32d856e8e038f (diff)
downloadcpython-89004d761361332314beb08b443bff5b092ec36e.zip
cpython-89004d761361332314beb08b443bff5b092ec36e.tar.gz
cpython-89004d761361332314beb08b443bff5b092ec36e.tar.bz2
[3.5] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc (GH-1683) (#1816)
* 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 bc50f03db4f58c869b78e98468e374d7e61f1227)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/_test_multiprocessing.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 0402128..b24e7d6 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -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))
+
#
#
#