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 self.dispatcher = dispatcher
@abc.abstractmethod @abc.abstractmethod
def start(self): def start(self, override_pool_size=None):
"""Start polling for incoming messages.""" """Start polling for incoming messages."""
@abc.abstractmethod @abc.abstractmethod

View File

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

View File

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