0rpc / zerorpc-python

zerorpc for python
http://www.zerorpc.io
Other
3.18k stars 382 forks source link

Is Client connection threadsafe? #113

Closed mengzhuo closed 9 years ago

mengzhuo commented 9 years ago

I had test on 1000 coroutines sharing one client, after all clients connected it will raise RemoteError: Lost heartbeat 10s.

bombela commented 9 years ago

A zerorpc client is not thread-safe but it is coroutine/green thread/greenlet safe, for the purpose of sharing a client and server across coroutines.

Make sure that your server code is not blocking the process and is gevent compatible. for example time.sleep will block the process and with it all the couroutines while gevent.sleep will block the current coroutine only. That could be the reason your server is not responding for example.

Best, FX

On Tue, Feb 3, 2015, 00:58 Meng Zhuo notifications@github.com wrote:

I had test on 1000 coroutines sharing one client, after all clients connected it will raise RemoteError: Lost heartbeat 10s.

— Reply to this email directly or view it on GitHub https://github.com/dotcloud/zerorpc-python/issues/113.

mengzhuo commented 9 years ago

Thanks! We find that it's our redis connection is blocking (not monkey patch yet)