]> git.ipfire.org Git - collecty.git/blobdiff - src/collecty/daemon.py
Do not crash write queue when a RRD file could not be written
[collecty.git] / src / collecty / daemon.py
index 0f1c34d7b77ce61e07d0adf4bd7da9b8c79496e8..236e1c93fb8ee3f548d43542a6e40481b1888389 100644 (file)
@@ -240,7 +240,14 @@ class WriteQueue(threading.Thread):
                for result in results:
                        self.log.debug("  %s: %s" % (result.time, result.data))
 
-               rrdtool.update(filename, *["%s" % r for r in results])
+               try:
+                       rrdtool.update(filename, *["%s" % r for r in results])
+
+               # Catch operational errors like unreadable/unwritable RRD databases
+               # or those where the format has changed. The collected data will be lost.
+               except rrdtool.OperationalError as e:
+                       self.log.critical(_("Could not update RRD database %s: %s") \
+                               % (filename, e))
 
 
 class QueueObject(object):