Change default for [kafka]num_processors to 1
Currently the default for [kafka]num_processors is 0. This can lead to the situation where monasca-persister starts but nothing happens because no processes are started. This can happen very easy in the default configuration where the "num_processors" value in the different sections ([kafka_alarm_history], [kafka_events], [kafka_metrics]) is set to: num_processors = $kafka.num_processors which means that in the default case, 0 processes are started. This is fixed now because the default for [kafka]num_processors is now 1. Change-Id: I2c8ed56bbe91648543044201d7b6320f88a724c7
This commit is contained in:
parent
e6d49a20c2
commit
6508384060
@ -42,7 +42,7 @@ kafka_common_opts = [
|
|||||||
default=32768),
|
default=32768),
|
||||||
cfg.IntOpt('num_processors',
|
cfg.IntOpt('num_processors',
|
||||||
help='Number of processes spawned by persister',
|
help='Number of processes spawned by persister',
|
||||||
default=0)
|
default=1)
|
||||||
]
|
]
|
||||||
|
|
||||||
kafka_common_group = cfg.OptGroup(name='kafka',
|
kafka_common_group = cfg.OptGroup(name='kafka',
|
||||||
|
@ -102,6 +102,10 @@ def prepare_processes(conf, repo_driver):
|
|||||||
for proc in range(0, conf.num_processors):
|
for proc in range(0, conf.num_processors):
|
||||||
processors.append(multiprocessing.Process(
|
processors.append(multiprocessing.Process(
|
||||||
target=start_process, args=(repository, conf)))
|
target=start_process, args=(repository, conf)))
|
||||||
|
else:
|
||||||
|
LOG.warning("Number of processors (num_processors) is {}".format(
|
||||||
|
conf.num_processors))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Start persister."""
|
"""Start persister."""
|
||||||
|
Loading…
Reference in New Issue
Block a user