Dispose DB connections between backend proc starts

Currently we do not dispose the existing DB pools before
forking off additional storage backend processes.  This can
result in timing issues and DB errors.

This change simply ensures that we do a dispose_engine() in
the loop where we are forking off processes for the storage
backends.

Change-Id: I4ce67e1ce7853fafe5318393482d841583e42098
Closes-bug: 1463580
This commit is contained in:
Jay S. Bryant 2015-06-09 17:10:18 -05:00
parent d31d73dfd1
commit bb683d6ce4
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,7 @@ i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config # noqa
from cinder.db import api as session
from cinder import service
from cinder import utils
from cinder import version
@ -70,6 +71,10 @@ def main():
server = service.Service.create(host=host,
service_name=backend,
binary='cinder-volume')
# Dispose of the whole DB connection pool here before
# starting another process. Otherwise we run into cases where
# child processes share DB connections which results in errors.
session.dispose_engine()
launcher.launch_service(server)
else:
server = service.Service.create(binary='cinder-volume')