From: Jay S. Bryant Date: Tue, 9 Jun 2015 22:10:18 +0000 (-0500) Subject: Dispose DB connections between backend proc starts X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bb683d6ce4f8e8ad6f1ba657eac5c7f92c9ea82f;p=openstack-build%2Fcinder-build.git 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 --- diff --git a/cinder/cmd/volume.py b/cinder/cmd/volume.py index f72864034..ed99dded3 100644 --- a/cinder/cmd/volume.py +++ b/cinder/cmd/volume.py @@ -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')