From 5c34dede63311c83dd0bf0210eca262f82300cfc Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 29 Apr 2013 08:15:51 +0100 Subject: [PATCH] Warn and reset `worker_threads` to the minimum of 3 if lower. --- salt/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/salt/config.py b/salt/config.py index 7a7c70092e..ea4ccda6d9 100644 --- a/salt/config.py +++ b/salt/config.py @@ -569,6 +569,16 @@ def apply_master_config(overrides=None, defaults=None): if isinstance(opts['file_ignore_glob'], str): opts['file_ignore_glob'] = [opts['file_ignore_glob']] + # Let's make sure `worker_threads` does not drop bellow 3 which has proven + # to make `salt.modules.publish` not work under the test-suite. + if opts['worker_threads'] < 3: + log.warning( + 'The \'worker_threads\' setting on {0!r} cannot be lower than 3. ' + 'Resetting it to the default value of 3.'.format( + opts['conf_file'] + ) + ) + opts['worker_threads'] = 3 return opts