Prevent negative --threads sizes, disable changing of tpool size for 1-thread as well as 0-threads

Change-Id: I06e8656b9b0e7f248711c701685b52b0458a5846
This commit is contained in:
R. Tyler Croy 2010-09-12 17:37:24 -07:00
parent 03f52026bf
commit 1cc76a1be2
1 changed files with 2 additions and 1 deletions

View File

@ -132,7 +132,8 @@ class Controller(object):
command.append('--reload')
env = environ()
tpool_size = int(self.config.get('threadpool_workers', 0))
if not tpool_size == 0:
assert tpool_size >= 0, (tpool_size, 'Cannot have a negative --threads argument')
if not tpool_size in (0, 1):
env['EVENTLET_THREADPOOL_SIZE'] = str(tpool_size)
os.execve(sys.executable, command, env)
os.close(child_side)