Merge "Use dispose_pool() from oslo.db"

This commit is contained in:
Jenkins 2016-08-26 22:03:41 +00:00 committed by Gerrit Code Review
commit d135b3fd25
3 changed files with 4 additions and 6 deletions

View File

@ -122,11 +122,9 @@ def get_engine():
return context_manager.get_legacy_facade().get_engine() return context_manager.get_legacy_facade().get_engine()
@removals.remove(version='newton', removal_version='Ocata')
def dispose(): def dispose():
# TODO(akamyshnikova): Use context_manager.dispose_pool() when it is context_manager.dispose_pool()
# available in oslo.db
if context_manager._factory._started:
get_engine().pool.dispose()
#TODO(akamyshnikova): when all places in the code, which use sessions/ #TODO(akamyshnikova): when all places in the code, which use sessions/

View File

@ -245,7 +245,7 @@ def _start_workers(workers):
# dispose the whole pool before os.fork, otherwise there will # dispose the whole pool before os.fork, otherwise there will
# be shared DB connections in child processes which may cause # be shared DB connections in child processes which may cause
# DB errors. # DB errors.
session.dispose() session.context_manager.dispose_pool()
for worker in process_workers: for worker in process_workers:
worker_launcher.launch_service(worker, worker_launcher.launch_service(worker,

View File

@ -188,7 +188,7 @@ class Server(object):
# dispose the whole pool before os.fork, otherwise there will # dispose the whole pool before os.fork, otherwise there will
# be shared DB connections in child processes which may cause # be shared DB connections in child processes which may cause
# DB errors. # DB errors.
api.dispose() api.context_manager.dispose_pool()
# The API service runs in a number of child processes. # The API service runs in a number of child processes.
# Minimize the cost of checking for child exit by extending the # Minimize the cost of checking for child exit by extending the
# wait interval past the default of 0.01s. # wait interval past the default of 0.01s.