From 6e48ff8224aba3564160a676e0ad58cf85079fb9 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 9 Nov 2018 11:31:04 -0800 Subject: [PATCH] only pass system errors to hub handler Fixes: http://tracker.ceph.com/issues/36731 Code suggested/contributed by Kefu. Signed-off-by: Patrick Donnelly --- teuthology/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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() -- 2.47.3