From: Patrick Donnelly Date: Fri, 9 Nov 2018 19:31:04 +0000 (-0800) Subject: only pass system errors to hub handler X-Git-Tag: 1.1.0~287^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1234%2Fhead;p=teuthology.git only pass system errors to hub handler Fixes: http://tracker.ceph.com/issues/36731 Code suggested/contributed by Kefu. Signed-off-by: Patrick Donnelly --- diff --git a/teuthology/__init__.py b/teuthology/__init__.py index ffafee9af..6f0b619c3 100644 --- a/teuthology/__init__.py +++ b/teuthology/__init__.py @@ -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()