diff --git a/masakari/conf/engine.py b/masakari/conf/engine.py index 118e3ae0..cd19227f 100644 --- a/masakari/conf/engine.py +++ b/masakari/conf/engine.py @@ -90,6 +90,7 @@ notification_opts = [ 'are in error or new state.'), cfg.IntOpt('retry_notification_new_status_interval', default=60, + mutable=True, help="Interval in seconds for identifying notifications which " "are in new state. If the notification is in new state " "till this config option value after it's " diff --git a/masakari/service.py b/masakari/service.py index 949a105f..df7eda94 100644 --- a/masakari/service.py +++ b/masakari/service.py @@ -271,7 +271,7 @@ class WSGIService(service.Service): def process_launcher(): - return service.ProcessLauncher(CONF) + return service.ProcessLauncher(CONF, restart_method='mutate') # NOTE: the global launcher is to maintain the existing @@ -285,7 +285,8 @@ def serve(server, workers=None): if _launcher: raise RuntimeError(_('serve() can only be called once')) - _launcher = service.launch(CONF, server, workers=workers) + _launcher = service.launch(CONF, server, workers=workers, + restart_method='mutate') def wait(): diff --git a/masakari/tests/unit/test_service.py b/masakari/tests/unit/test_service.py index 04609ee1..a7c9d52c 100644 --- a/masakari/tests/unit/test_service.py +++ b/masakari/tests/unit/test_service.py @@ -160,7 +160,8 @@ class TestLauncher(test.NoDBTestCase): service.serve(mock.sentinel.service) mock_launch.assert_called_once_with(mock.ANY, mock.sentinel.service, - workers=None) + workers=None, + restart_method='mutate') @mock.patch.object(_service, 'launch') def test_launch_app_with_workers(self, mock_launch): @@ -168,7 +169,8 @@ class TestLauncher(test.NoDBTestCase): service.serve(mock.sentinel.service, workers=mock.sentinel.workers) mock_launch.assert_called_once_with(mock.ANY, mock.sentinel.service, - workers=mock.sentinel.workers) + workers=mock.sentinel.workers, + restart_method='mutate') @mock.patch.object(_service, 'launch') def test_launch_app_more_than_once_raises(self, mock_launch): diff --git a/releasenotes/notes/bp-mutable-config-57efdd467c01aa7b.yaml b/releasenotes/notes/bp-mutable-config-57efdd467c01aa7b.yaml new file mode 100644 index 00000000..8bb86cc8 --- /dev/null +++ b/releasenotes/notes/bp-mutable-config-57efdd467c01aa7b.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Masakari has been enabled for mutable config. + Below option may be reloaded by sending SIGHUP to the correct process. + + 'retry_notification_new_status_interval' option will apply to process + unfinished notifications.