Skip to content
Snippets Groups Projects
Commit 90ca6796 authored by Antoine Millet's avatar Antoine Millet
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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
call['event'].set()
else:
msg = {'id': cid, 'error': err, 'return': None}
self._manager.signal_arrival(msg)
if callback is not None and not callable(callback):
if self._handler is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment