irmen / Pyro5

Pyro 5 - Python remote objects
https://pyro5.readthedocs.io
MIT License
312 stars 36 forks source link

[FEAT] Add remote methode deadlock detection on the server side #94

Open arnaudiko opened 3 months ago

arnaudiko commented 3 months ago

I'm currently trying to detect a thread deadlocked in the remote method on the server side. The goal is to auto restart the server in this case. To do that I have create a custom Daemon. In my custome Daemon, I add a decoration to the "handleRequest" methode to measure the time between the input and the output (for each thread). Then I check, in an overload of the "housekeeping", if we have a deadlock in one of the watched thread.

It's works but if the client dosen't send request during a while, my code detect fault deadlock. This is du to the "protocol.recv_stub" call in the "pyro.Deamon.handleRequest" methode that wait a new client request.

Is there another solution for my need? If not, can you please add a system in pyro to manage my need ? or add hooks before and after the calling a a remote method on the server?