From f8149fc83f5e951b60d391741f0f9ae92c673533 Mon Sep 17 00:00:00 2001 From: "Jay S. Bryant" Date: Tue, 9 Jun 2015 17:10:18 -0500 Subject: [PATCH] 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 (cherry picked from commit bb683d6ce4f8e8ad6f1ba657eac5c7f92c9ea82f) --- cinder/cmd/volume.py | 5 +++++ 1 file changed, 5 insertions(+) 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') -- 2.45.2