]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
only pass system errors to hub handler 1234/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 9 Nov 2018 19:31:04 +0000 (11:31 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 19 Nov 2018 18:18:17 +0000 (10:18 -0800)
Fixes: http://tracker.ceph.com/issues/36731
Code suggested/contributed by Kefu.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
teuthology/__init__.py

index ffafee9af230ccda2e8288506232de9b1d214c90..6f0b619c3139585bf4a065b38e9e9e3608e03c91 100644 (file)
@@ -100,11 +100,13 @@ def patch_gevent_hub_error_handler():
     Hub._origin_handle_error = Hub.handle_error
 
     def custom_handle_error(self, context, type, value, tb):
-        if not issubclass(type, Hub.SYSTEM_ERROR + Hub.NOT_ERROR):
+        if context is None or issubclass(type, Hub.SYSTEM_ERROR):
+            self.handle_system_error(type, value)
+        elif issubclass(type, Hub.NOT_ERROR):
+            pass
+        else:
             log.error("Uncaught exception (Hub)", exc_info=(type, value, tb))
 
-        self._origin_handle_error(context, type, value, tb)
-
     Hub.handle_error = custom_handle_error
 
 patch_gevent_hub_error_handler()