Open chrahunt opened 5 years ago
We could use python-prctl
however it works by overwriting the **argv
for a process, which is less elegant than some of the solutions above, and would require us to re-exec with a large-enough command-line to accommodate most use cases.
There are three processes involved in handling of requests: client, server, and handler. The current command lines are:
This is pretty unexpected, since most users would assume that the command-line reflects the actual work being done. A more friendly approach would be:
(cli client) {command line}
- clearly showing the role of the process which can make it easier to identify the correct process to kill (i.e. not this one)(cli server) {server name}
- where{server name}
is the name passed to thecli_factory
decorator, also helps to identify the process{command line}
- this reflects the actual work being done by the process, and is one of the first things that users of a cli would look for if grepping ps output or usingpkill
. Actually killing the handler process directly would also lead to the most intuitive outcome - the client that is running in the foreground of a shell would exit with the expected return codeImplementation notes: