[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

Thomas Moreau report at bugs.python.org
Sun Jun 4 04:59:35 EDT 2017


Thomas Moreau added the comment:

I think this is a good solution as it let the user define easily the behavior it needs in other situation too. I would recommend adding the object responsible for the failure to the _on_queue_thread_error callback. This would simplify the error handling.


@@ -260,8 +260,16 @@ class Queue(object):
                     info('error in queue thread: %s', e)
                     return
                 else:
-                    import traceback
-                    traceback.print_exc()
+                    self._on_queue_thread_error(e, obj)
+
+    def _on_queue_thread_error(self, e, obj):
+        """
+        Private API called when feeding data in the background thread
+        raises an exception.  For overriding by concurrent.futures.
+        """
+        import traceback
+        traceback.print_exc()
+

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30414>
_______________________________________


More information about the Python-bugs-list mailing list