]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/zabbix: log exceptions with backtrace 18734/head
authorJohn Spray <john.spray@redhat.com>
Sat, 23 Sep 2017 14:22:34 +0000 (15:22 +0100)
committerShinobu Kinjo <shinobu@redhat.com>
Sat, 4 Nov 2017 20:42:49 +0000 (05:42 +0900)
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 <john.spray@redhat.com>
(cherry picked from commit 316dcc8f0b42b85503632d5472c45c9828882f2c)

src/pybind/mgr/zabbix/module.py

index a7baac1ba69004252ae360d2368dc24e6258c5d8..c2125a942eed19b07033f4bc5ff59535f67d4086 100644 (file)
@@ -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)