Commit 90ca6796 authored by Antoine Millet's avatar Antoine Millet

Fixed a bug with dropped connections and async requests.

When a connection is dropped, all "wait" operations of asynchronous calls
are now released with an error message, exactly like synchronous calls.:
parent e239e1e1
......@@ -396,12 +396,16 @@ class RpcConnection(object):
logging.debug('Error while socket close: %s.', err)
# Release all running calls from this connection:
for call in self._calls.values():
for cid, call in self._calls.iteritems():
err = {'exception': 'RpcError',
'message': 'Connection reset by peer'}
if 'event' in call:
call['error'] = {'exception': 'RpcError',
'message': 'Connection reset by peer'}
call['error'] = err
call['return'] = None
msg = {'id': cid, 'error': err, 'return': None}
if callback is not None and not callable(callback):
if self._handler is not None:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment