Merge "Change default num_retries for glance to 3" into stable/stein
This commit is contained in:
commit
d0cb291eea
|
@ -44,7 +44,7 @@ Possible values:
|
||||||
(i.e. "http://10.0.1.0:9292" or "https://my.glance.server/image").
|
(i.e. "http://10.0.1.0:9292" or "https://my.glance.server/image").
|
||||||
"""),
|
"""),
|
||||||
cfg.IntOpt('num_retries',
|
cfg.IntOpt('num_retries',
|
||||||
default=0,
|
default=3,
|
||||||
min=0,
|
min=0,
|
||||||
help="""
|
help="""
|
||||||
Enable glance operation retries.
|
Enable glance operation retries.
|
||||||
|
|
|
@ -148,7 +148,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||||
mock_sr_path.assert_called_once_with(self.session)
|
mock_sr_path.assert_called_once_with(self.session)
|
||||||
mock_extra_header.assert_called_once_with(self.context)
|
mock_extra_header.assert_called_once_with(self.context)
|
||||||
mock_upload.assert_called_once_with(
|
mock_upload.assert_called_once_with(
|
||||||
self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
|
self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
|
||||||
'fake_sr_path', 'fake_extra_header', **params)
|
'fake_sr_path', 'fake_extra_header', **params)
|
||||||
|
|
||||||
@mock.patch.object(utils, 'get_auto_disk_config_from_instance')
|
@mock.patch.object(utils, 'get_auto_disk_config_from_instance')
|
||||||
|
@ -169,7 +169,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||||
mock_sr_path.assert_called_once_with(self.session)
|
mock_sr_path.assert_called_once_with(self.session)
|
||||||
mock_extra_header.assert_called_once_with(self.context)
|
mock_extra_header.assert_called_once_with(self.context)
|
||||||
mock_upload.assert_called_once_with(
|
mock_upload.assert_called_once_with(
|
||||||
self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
|
self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
|
||||||
'fake_sr_path', 'fake_extra_header', **params)
|
'fake_sr_path', 'fake_extra_header', **params)
|
||||||
mock_disk_config.assert_called_once_with(self.instance)
|
mock_disk_config.assert_called_once_with(self.instance)
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||||
mock_sr_path.assert_called_once_with(self.session)
|
mock_sr_path.assert_called_once_with(self.session)
|
||||||
mock_extra_header.assert_called_once_with(self.context)
|
mock_extra_header.assert_called_once_with(self.context)
|
||||||
mock_upload.assert_called_once_with(
|
mock_upload.assert_called_once_with(
|
||||||
self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
|
self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
|
||||||
'fake_sr_path', 'fake_extra_header', **params)
|
'fake_sr_path', 'fake_extra_header', **params)
|
||||||
mock_disk_config.assert_called_once_with(self.instance)
|
mock_disk_config.assert_called_once_with(self.instance)
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||||
mock_sr_path.assert_called_once_with(self.session)
|
mock_sr_path.assert_called_once_with(self.session)
|
||||||
mock_extra_header.assert_called_once_with(self.context)
|
mock_extra_header.assert_called_once_with(self.context)
|
||||||
mock_upload.assert_called_once_with(
|
mock_upload.assert_called_once_with(
|
||||||
self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
|
self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
|
||||||
'fake_sr_path', 'fake_extra_header', **params)
|
'fake_sr_path', 'fake_extra_header', **params)
|
||||||
|
|
||||||
@mock.patch.object(common_glance, 'generate_identity_headers')
|
@mock.patch.object(common_glance, 'generate_identity_headers')
|
||||||
|
@ -231,7 +231,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||||
mock_sr_path.assert_called_once_with(self.session)
|
mock_sr_path.assert_called_once_with(self.session)
|
||||||
mock_extra_header.assert_called_once_with(self.context)
|
mock_extra_header.assert_called_once_with(self.context)
|
||||||
mock_upload.assert_called_once_with(
|
mock_upload.assert_called_once_with(
|
||||||
self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
|
self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
|
||||||
'fake_sr_path', 'fake_extra_header', **params)
|
'fake_sr_path', 'fake_extra_header', **params)
|
||||||
|
|
||||||
@mock.patch.object(time, 'sleep')
|
@mock.patch.object(time, 'sleep')
|
||||||
|
@ -330,5 +330,5 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||||
mock_sr_path.assert_called_once_with(self.session)
|
mock_sr_path.assert_called_once_with(self.session)
|
||||||
mock_extra_header.assert_called_once_with(self.context)
|
mock_extra_header.assert_called_once_with(self.context)
|
||||||
mock_upload.assert_called_once_with(
|
mock_upload.assert_called_once_with(
|
||||||
self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
|
self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
|
||||||
'fake_sr_path', 'fake_extra_header', **params)
|
'fake_sr_path', 'fake_extra_header', **params)
|
||||||
|
|
|
@ -258,7 +258,7 @@ class FetchVhdImageTestCase(VMUtilsTestBase):
|
||||||
self.mock_call_plugin.assert_called_once_with(
|
self.mock_call_plugin.assert_called_once_with(
|
||||||
'glance.py',
|
'glance.py',
|
||||||
'download_vhd2',
|
'download_vhd2',
|
||||||
0,
|
3,
|
||||||
mock.ANY,
|
mock.ANY,
|
||||||
mock.ANY,
|
mock.ANY,
|
||||||
extra_headers={'X-Auth-Token': 'auth_token',
|
extra_headers={'X-Auth-Token': 'auth_token',
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The default for ``[glance] num_retries`` has changed from ``0`` to ``3``.
|
||||||
|
The option controls how many times to retry a Glance API call in response
|
||||||
|
to a HTTP connection failure. When deploying Glance behind HAproxy it is
|
||||||
|
possible for a response to arrive just after the HAproxy idle time. As a
|
||||||
|
result, an exception will be raised when the connection is closed resulting
|
||||||
|
in a failed request. By increasing the default value, Nova can be more
|
||||||
|
resilient to this scenario were HAproxy is misconfigured by retrying the
|
||||||
|
request.
|
Loading…
Reference in New Issue