]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
sqlalchemy exception kills FixedIntervalLoopingCall thread
authorscottda <scott.dangelo@hp.com>
Thu, 30 Jul 2015 16:08:41 +0000 (16:08 +0000)
committerscottda <scott.dangelo@hp.com>
Thu, 30 Jul 2015 16:17:17 +0000 (16:17 +0000)
Transient DB errors should not kill the thread for FixedIntervalLoopingCall.
This was noticed and fixed for the DBError case in Bug#1466991, but the
exception from sqlalchemy is not handled. Basically, self.model_disconnected
should be set to True, but the looping thread should carry on regardless of
the error.

Change-Id: I4bf04392269a2c33b77166b6c7408b38e1bc992d
Closes-Bug: #1478971

cinder/service.py

index 95010fa05ac6a6583dbad5a57c643f04a2eb4e77..01f929edee903460ef11b5be18666a84757a0a36 100644 (file)
@@ -336,6 +336,11 @@ class Service(service.Service):
                 self.model_disconnected = True
                 LOG.exception(_LE('DBError encountered: '))
 
+        except Exception:
+            if not getattr(self, 'model_disconnected', False):
+                self.model_disconnected = True
+                LOG.exception(_LE('Exception encountered: '))
+
 
 class WSGIService(service.ServiceBase):
     """Provides ability to launch API from a 'paste' configuration."""