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
# 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
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')