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()
@removals.remove(version='newton', removal_version='Ocata')
def dispose():
# TODO(akamyshnikova): Use context_manager.dispose_pool() when it is
# available in oslo.db
if context_manager._factory._started:
get_engine().pool.dispose()
context_manager.dispose_pool()
#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
# be shared DB connections in child processes which may cause
# DB errors.
session.dispose()
session.context_manager.dispose_pool()
for worker in process_workers:
worker_launcher.launch_service(worker,

View File

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