Comments (4)
The reason the above method does not work is that the signal is being absorbed by the thread running the connection to your client (my best guess without testing/breakpoints/debugging myself). Each client will result in their own thread spawn when using ThreadedServer. From a system administration standpoint, it would make more sense to terminate the process using whatever starts your server — if you are using something like systemd it would potentially restart the service if you try doing it this way.
If you want a pure RPyC solution, I would say you would probably want to inherit the threaded server and extend it to do one of the following:
- intercept the shutdown request
- add support for propagating signals from your thread
- Try calling os.exit or sys.exit, but this is dirty and wouldn't exit cleanly.
As for where to ask questions, here is okay. I respond on best effort.
from rpyc.
Looks like I need to patch _accept_method
, and that is fairly complicated to do, I guess I'll probably stick to kill to just kill the process.
from rpyc.
I'll take a look once I have time. In my case the server is a forked subprocess of the client, and the Cilent is a textual TUI app.
from rpyc.
@glyh , iirc, when I did this for an electron desktop in the past, rather than forking the process, try keep the the server as a child process and sending the signal from the client/TUI-app. Of course, there needs to be signal handling for the RPyC server process — if I have time, I will check the docs for an example or try to write one this weekend.
From what I remember, RPyC does not document how to do this very well. There is certainly room for enhancement of RPyC regarding signal handling and related documentation (i.e., the ThreadedServer
has many "gotchas" for signal handling).
from rpyc.
Related Issues (20)
- pyproject.toml value for license key should be a table, not a string HOT 1
- ervice HOT 1
- Large list of dicts transmit inefficiently as netref HOT 2
- How to poll an AsyncResult without blocking? HOT 3
- using rpyc as build in proxy in app to dispatch message to remote clinet
- How to cancel all the pending requests at the server?
- 5.3.1: sphinx warnings `reference target not found` HOT 2
- 5.3.1: pytest is failing in `tests/test_win32pipes.py::Test_NamedPipe::test_rpyc` unit HOT 6
- server side call client side callback function not work HOT 1
- Documentation on how to start/stop/reload/restart a RPyC service via systemctl services
- Compatibility issue with urllib3
- Allow a Server to expose multiple Services
- rpyc zerodeploy EOF during classic_connect (linux only)
- rpyc not working on py-3.12.1 HOT 4
- Specify a point of contact for security-related issues HOT 1
- ValueError: invalid message type: 18 between Server 5.0.1 and Client 6.0.0 HOT 2
- AttributeError: 'dict' object has no attribute 'shape'
- unix-socket unexpectetly closed by client
- 6.0.0: pytest fails in 6 units HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpyc.