From 8cacd2a568fca023a51f3be6e20f90b4ec08c82b Mon Sep 17 00:00:00 2001 From: John Spray Date: Sat, 23 Sep 2017 15:22:34 +0100 Subject: [PATCH] mgr/zabbix: log exceptions with backtrace Logging just the exception object gave a sometimes-enigmatic single line. Let's use the logger exception method so that we get a backtrace. Signed-off-by: John Spray (cherry picked from commit 316dcc8f0b42b85503632d5472c45c9828882f2c) --- src/pybind/mgr/zabbix/module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index a7baac1ba6900..c2125a942eed1 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -260,11 +260,12 @@ class Module(MgrModule): while self.run: self.log.debug('Waking up for new iteration') - # Sometimes fetching data fails, should be fixed by PR #16020 try: self.send() except Exception as exc: - self.log.error(exc) + # Shouldn't happen, but let's log it and retry next interval, + # rather than dying completely. + self.log.exception("Unexpected error during send():") interval = self.config['interval'] self.log.debug('Sleeping for %d seconds', interval) -- 2.39.5