Hi there,
I've started implementing zerorpc into a set of Django based microservices.
A simple usage scenario I have in one service is to provide a 'list' and 'get' rpc calls to get many or one model data.
The 'list' method yields (stream) each model as a dict, while the 'get' method simply returns the model as a dict by id.
All is fine, except that I'm getting fairly random "LostRemote: Lost remote after 10s heartbeat" exceptions in my local tests.
I am instantiating a client:
And then issuing (in the shell) a series of 'gets' and lists:
> many = client.get_many()
> next(records)
> {'record': 12345}
> next(records)
> {'record': 98765}
> client.get_one(123)
> {'record': 123}
> client.get_one(123)
> {'record': 123}
> client.get_one(123)
> {'record': 123}
> LostRemote: Lost remote after 10s heartbeat
> client.get_one(123)
> {'record': 123}
At this point, after i fire a few of those calls, even without any break between them, I will get a LostRemote exception thrown. This seems to be pretty random. Even if a request is made every half a second I will still get that raised.
My question is then, what is the best practice to AVOID those? I don't want to lose requests because of that.
Do I need to instantiate a new client before each call?
How can I debug this? Is there documentation about all the arguments to the server and client? For example how to run in a debug mode?
Do i need to manage those failures myself?
Thanks
Harel