Merge "fix override_pool_size"

This commit is contained in:
Jenkins 2016-02-19 14:03:15 +00:00 committed by Gerrit Code Review
commit 29f34d4419
3 changed files with 8 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class ExecutorBase(object):
self.dispatcher = dispatcher
@abc.abstractmethod
def start(self):
def start(self, override_pool_size=None):
"""Start polling for incoming messages."""
@abc.abstractmethod

View File

@ -330,7 +330,7 @@ class MessageHandlingServer(service.ServiceBase, _OrderedTaskRunner):
super(MessageHandlingServer, self).__init__()
@ordered(reset_after='stop')
def start(self):
def start(self, override_pool_size=None):
"""Start handling incoming messages.
This method causes the server to begin polling the transport for
@ -358,7 +358,7 @@ class MessageHandlingServer(service.ServiceBase, _OrderedTaskRunner):
except driver_base.TransportDriverError as ex:
raise ServerListenError(self.target, ex)
executor = self._executor_cls(self.conf, listener, self.dispatcher)
executor.start()
executor.start(override_pool_size=override_pool_size)
self._executor_obj = executor
if self.executor == 'blocking':

View File

@ -553,7 +553,10 @@ class TestServerLocking(test_utils.BaseTestCase):
self.listener = mock.MagicMock()
executors.append(self)
start = _logmethod('start')
def start(self, override_pool_size=None):
with self._lock:
self._calls.append('start')
stop = _logmethod('stop')
wait = _logmethod('wait')
execute = _logmethod('execute')
@ -611,7 +614,7 @@ class TestServerLocking(test_utils.BaseTestCase):
runner = [None]
class SteppingFakeExecutor(self.server._executor_cls):
def start(self):
def start(self, override_pool_size=None):
# Tell the test which thread won the race
runner[0] = eventlet.getcurrent()
running_event.set()