Merge "Add a request_timeout to neutron"
This commit is contained in:
commit
46533ebea2
@ -87,7 +87,8 @@ def get_client(token=None, context=None):
|
|||||||
auth=user_auth or service_auth,
|
auth=user_auth or service_auth,
|
||||||
endpoint_override=endpoint,
|
endpoint_override=endpoint,
|
||||||
retries=CONF.neutron.retries,
|
retries=CONF.neutron.retries,
|
||||||
global_request_id=context.global_id)
|
global_request_id=context.global_id,
|
||||||
|
timeout=CONF.neutron.request_timeout)
|
||||||
|
|
||||||
|
|
||||||
def unbind_neutron_port(port_id, client=None, context=None):
|
def unbind_neutron_port(port_id, client=None, context=None):
|
||||||
|
@ -108,6 +108,15 @@ opts = [
|
|||||||
'"neutron" network interface and not used for the '
|
'"neutron" network interface and not used for the '
|
||||||
'"flat" or "noop" network interfaces. If not '
|
'"flat" or "noop" network interfaces. If not '
|
||||||
'specified, the default security group is used.')),
|
'specified, the default security group is used.')),
|
||||||
|
cfg.IntOpt('request_timeout',
|
||||||
|
default=45,
|
||||||
|
help=_('Timeout for request processing when interacting '
|
||||||
|
'with Neutron. This value should be increased if '
|
||||||
|
'neutron port action timeouts are observed as neutron '
|
||||||
|
'performs pre-commit validation prior returning to '
|
||||||
|
'the API client which can take longer than normal '
|
||||||
|
'client/server interactions.')),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ class TestNeutronClient(base.TestCase):
|
|||||||
session=mock.sentinel.session,
|
session=mock.sentinel.session,
|
||||||
auth=auth, retries=2,
|
auth=auth, retries=2,
|
||||||
endpoint_override=url,
|
endpoint_override=url,
|
||||||
global_request_id='global')
|
global_request_id='global',
|
||||||
|
timeout=45)
|
||||||
|
|
||||||
@mock.patch('ironic.common.context.RequestContext', autospec=True)
|
@mock.patch('ironic.common.context.RequestContext', autospec=True)
|
||||||
def test_get_neutron_client_with_token(self, mock_ctxt, mock_client_init,
|
def test_get_neutron_client_with_token(self, mock_ctxt, mock_client_init,
|
||||||
@ -84,7 +85,8 @@ class TestNeutronClient(base.TestCase):
|
|||||||
auth=mock.sentinel.sauth,
|
auth=mock.sentinel.sauth,
|
||||||
retries=2,
|
retries=2,
|
||||||
endpoint_override='neutron_url',
|
endpoint_override='neutron_url',
|
||||||
global_request_id=ctxt.global_id)
|
global_request_id=ctxt.global_id,
|
||||||
|
timeout=45)
|
||||||
|
|
||||||
# testing handling of default url_timeout
|
# testing handling of default url_timeout
|
||||||
mock_session.assert_called_once_with('neutron', timeout=10)
|
mock_session.assert_called_once_with('neutron', timeout=10)
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes an issue that can occur in CI and in physical deployments where the
|
||||||
|
Networking Service performs a pre-flight operation which can exceed
|
||||||
|
the prior default for ``30`` seconds. The new default is ``45`` seconds,
|
||||||
|
and operators can tune the setting via the ``[neutron]request_timeout``
|
||||||
|
setting.
|
Loading…
Reference in New Issue
Block a user