diff --git a/kuryr_kubernetes/clients.py b/kuryr_kubernetes/clients.py index 1b7afb56c..893324890 100644 --- a/kuryr_kubernetes/clients.py +++ b/kuryr_kubernetes/clients.py @@ -17,6 +17,7 @@ from functools import partial import ipaddress import os +from keystoneauth1 import session as k_session from kuryr.lib import utils from openstack import connection from openstack import exceptions as os_exc @@ -154,6 +155,14 @@ def handle_neutron_errors(method, *args, **kwargs): def setup_openstacksdk(): auth_plugin = utils.get_auth_plugin('neutron') session = utils.get_keystone_session('neutron', auth_plugin) + + # NOTE(mdulko): To get rid of warnings about connection pool being full + # we need to "tweak" the keystoneauth's adapters increasing + # the maximum pool size. + for scheme in list(session.session.adapters): + session.session.mount(scheme, k_session.TCPKeepAliveAdapter( + pool_maxsize=1000)) + # TODO(mdulko): To use Neutron's ability to do compare-and-swap updates we # need to manually add support for inserting If-Match header # into requests. At the moment we only need it for ports.