Merge "Set default to prevent out of memory conditions"
This commit is contained in:
commit
d65c486592
@ -361,7 +361,7 @@ service_opts = [
|
|||||||
'conductor and API services')),
|
'conductor and API services')),
|
||||||
cfg.BoolOpt('minimum_memory_warning_only',
|
cfg.BoolOpt('minimum_memory_warning_only',
|
||||||
mutable=True,
|
mutable=True,
|
||||||
default=True,
|
default=False,
|
||||||
help=_('Setting to govern if Ironic should only warn instead '
|
help=_('Setting to govern if Ironic should only warn instead '
|
||||||
'of attempting to hold back the request in order to '
|
'of attempting to hold back the request in order to '
|
||||||
'prevent the exhaustion of system memory.')),
|
'prevent the exhaustion of system memory.')),
|
||||||
|
@ -452,7 +452,6 @@ class TempFilesTestCase(base.TestCase):
|
|||||||
@mock.patch.object(time, 'sleep', autospec=True)
|
@mock.patch.object(time, 'sleep', autospec=True)
|
||||||
@mock.patch.object(psutil, 'virtual_memory', autospec=True)
|
@mock.patch.object(psutil, 'virtual_memory', autospec=True)
|
||||||
def test_is_memory_insufficent(self, mock_vm_check, mock_sleep):
|
def test_is_memory_insufficent(self, mock_vm_check, mock_sleep):
|
||||||
self.config(minimum_memory_warning_only=False)
|
|
||||||
|
|
||||||
class vm_check(object):
|
class vm_check(object):
|
||||||
available = 1000000000
|
available = 1000000000
|
||||||
@ -465,7 +464,6 @@ class TempFilesTestCase(base.TestCase):
|
|||||||
@mock.patch.object(psutil, 'virtual_memory', autospec=True)
|
@mock.patch.object(psutil, 'virtual_memory', autospec=True)
|
||||||
def test_is_memory_insufficent_good(self, mock_vm_check,
|
def test_is_memory_insufficent_good(self, mock_vm_check,
|
||||||
mock_sleep):
|
mock_sleep):
|
||||||
self.config(minimum_memory_warning_only=False)
|
|
||||||
|
|
||||||
class vm_check(object):
|
class vm_check(object):
|
||||||
available = 3276700000
|
available = 3276700000
|
||||||
@ -492,6 +490,19 @@ class TempFilesTestCase(base.TestCase):
|
|||||||
self.assertFalse(utils.is_memory_insufficent())
|
self.assertFalse(utils.is_memory_insufficent())
|
||||||
self.assertEqual(3, mock_vm_check.call_count)
|
self.assertEqual(3, mock_vm_check.call_count)
|
||||||
|
|
||||||
|
@mock.patch.object(time, 'sleep', autospec=True)
|
||||||
|
@mock.patch.object(psutil, 'virtual_memory', autospec=True)
|
||||||
|
def test_is_memory_insufficent_warning_only(self, mock_vm_check,
|
||||||
|
mock_sleep):
|
||||||
|
self.config(minimum_memory_warning_only=True)
|
||||||
|
|
||||||
|
class vm_check_bad(object):
|
||||||
|
available = 1023000000
|
||||||
|
|
||||||
|
mock_vm_check.side_effect = vm_check_bad
|
||||||
|
self.assertFalse(utils.is_memory_insufficent())
|
||||||
|
self.assertEqual(2, mock_vm_check.call_count)
|
||||||
|
|
||||||
|
|
||||||
class GetUpdatedCapabilitiesTestCase(base.TestCase):
|
class GetUpdatedCapabilitiesTestCase(base.TestCase):
|
||||||
|
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
By default Ironic will now not start new memory intensive work IF
|
||||||
|
insufficent system memory exists. This can be disabled by setting
|
||||||
|
the ``[DEFAULT]minimum_memory_warning_only`` value to ``True``.
|
Loading…
x
Reference in New Issue
Block a user