ZMQ: Allow to raise remote exception

This patch adds possibility to re-raise on client's side exception, that
was raised on server side - serialize it on server side, restore and
re-raise on client.
Allowed to pass `allowed_remote_exmods` parameter from impl_zmq to
CallRequest class

Functional test CallTestCase.test_exception() passes now, so added it to
tox.ini. Modified zmq_receiver to be able run functional tests.

Change-Id: Ic055f3574962f3e80a0528d5d99320386303634e
This commit is contained in:
Victor Sergeyev
2015-07-09 11:39:31 +03:00
committed by Oleksii Zamiatin
parent 7df65f2937
commit bcdc0e88ec
11 changed files with 43 additions and 17 deletions

View File

@@ -71,6 +71,11 @@ zmq_opts = [
default=30,
help='Seconds to wait before a cast expires (TTL). '
'Only supported by impl_zmq.'),
cfg.IntOpt('rpc_poll_timeout',
default=1,
help='The default number of seconds that poll should wait. '
'Poll raises timeout exception when timeout expired.'),
]
@@ -95,7 +100,8 @@ class ZmqDriver(base.BaseDriver):
def send(self, target, ctxt, message, wait_for_reply=None, timeout=None,
retry=None):
if self.client is None:
self.client = zmq_client.ZmqClient(self.conf, self.matchmaker)
self.client = zmq_client.ZmqClient(self.conf, self.matchmaker,
self._allowed_remote_exmods)
if wait_for_reply:
return self.client.call(target, ctxt, message, timeout, retry)
else: