From c0f6a6e9e9b8713d12a02b8441c7616c24871526 Mon Sep 17 00:00:00 2001 From: scottda Date: Thu, 30 Jul 2015 16:08:41 +0000 Subject: [PATCH] sqlalchemy exception kills FixedIntervalLoopingCall thread 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cinder/service.py b/cinder/service.py index 95010fa05..01f929ede 100644 --- a/cinder/service.py +++ b/cinder/service.py @@ -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.""" -- 2.45.2