Enable mutable config in Neutron

New releases of oslo.config support a 'mutable' parameter to Opts.
This is only respected when the new method mutate_config_files is
called instead of reload_config_files. Neutron delegates making this
call to oslo.service. This was provided in patchset
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e

Further patches will be needed to make select config options be
marked as mutable. This change enables support for oslo provided
config options to be updated via SIGHUP such as log level.

Task: 6389
Story: 2001545

Change-Id: I9442965607f3248706464643c6d87a04edcae24e
This commit is contained in:
Sławek Kapłoński 2018-03-19 15:21:43 +01:00 committed by Slawek Kaplonski
parent c888425fa9
commit b6b23a8f77
8 changed files with 11 additions and 10 deletions

View File

@ -47,4 +47,4 @@ def main():
topic=topics.DHCP_AGENT,
report_interval=cfg.CONF.AGENT.report_interval,
manager='neutron.agent.dhcp.agent.DhcpAgentWithStateReport')
service.launch(cfg.CONF, server).wait()
service.launch(cfg.CONF, server, restart_method='mutate').wait()

View File

@ -51,4 +51,4 @@ def main(manager='neutron.agent.l3.agent.L3NATAgentWithStateReport'):
topic=topics.L3_AGENT,
report_interval=cfg.CONF.AGENT.report_interval,
manager=manager)
service.launch(cfg.CONF, server).wait()
service.launch(cfg.CONF, server, restart_method='mutate').wait()

View File

@ -1034,5 +1034,5 @@ def main():
LB_AGENT_BINARY)
setup_profiler.setup("neutron-linuxbridge-agent", cfg.CONF.host)
LOG.info("Agent initialized successfully, now running... ")
launcher = service.launch(cfg.CONF, agent)
launcher = service.launch(cfg.CONF, agent, restart_method='mutate')
launcher.wait()

View File

@ -222,5 +222,5 @@ def main():
constants.AGENT_TYPE_MACVTAP,
MACVTAP_AGENT_BINARY)
LOG.info("Agent initialized successfully, now running... ")
launcher = service.launch(cfg.CONF, agent)
launcher = service.launch(cfg.CONF, agent, restart_method='mutate')
launcher.wait()

View File

@ -2132,7 +2132,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
self.catch_sigterm = False
if self.catch_sighup:
LOG.info("Agent caught SIGHUP, resetting.")
self.conf.reload_config_files()
self.conf.mutate_config_files()
config.setup_logging()
LOG.debug('Full set of CONF:')
self.conf.log_opt_values(LOG, logging.DEBUG)

View File

@ -200,7 +200,8 @@ class AllServicesNeutronWorker(neutron_worker.BaseWorker):
def __init__(self, services, worker_process_count=1):
super(AllServicesNeutronWorker, self).__init__(worker_process_count)
self._services = services
self._launcher = common_service.Launcher(cfg.CONF)
self._launcher = common_service.Launcher(cfg.CONF,
restart_method='mutate')
def start(self):
for srv in self._services:
@ -226,7 +227,7 @@ def _start_workers(workers):
try:
if process_workers:
worker_launcher = common_service.ProcessLauncher(
cfg.CONF, wait_interval=1.0
cfg.CONF, wait_interval=1.0, restart_method='mutate'
)
# add extra process worker and spawn there all workers with

View File

@ -296,4 +296,4 @@ def main():
report_interval=cfg.CONF.AGENT.report_interval,
manager='neutron.services.metering.agents.'
'metering_agent.MeteringAgentWithStateReport')
service.launch(cfg.CONF, server).wait()
service.launch(cfg.CONF, server, restart_method='mutate').wait()

View File

@ -192,8 +192,8 @@ class Server(object):
# The API service runs in a number of child processes.
# Minimize the cost of checking for child exit by extending the
# wait interval past the default of 0.01s.
self._server = common_service.ProcessLauncher(cfg.CONF,
wait_interval=1.0)
self._server = common_service.ProcessLauncher(
cfg.CONF, wait_interval=1.0, restart_method='mutate')
self._server.launch_service(service,
workers=service.worker_process_count)