Merge "Use dispose_pool() from oslo.db"
This commit is contained in:
commit
d135b3fd25
@ -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/
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user