Situation:
I am using multiprocessing.managers.BaseManager([address[, authkey]])
for python cross-process communication. I am having two scripts now, one serves as a base manager server which runs BaseManager.start()
and one serves as a client to read the data from the server`.
Obstacle:
When I run the server script, two python.exe with different PID can be seen from my Windows Task Manager. As I can understand, one is the main(parent) process and one is the spawned subprocess from BaseMange.start()
. This is fine.
I found that if I kill the main process' python.exe the BaseManager's python.exe will still be alive.
Reason that I am doing this is because I need to launch/ kill python scripts form NodeJS using require(child-process).spawn which will only kill the main process.
According to the documentation. It says Manager processes will be shutdown as soon as they are garbage collected or their parent process exits which does not match what I've seen from Windows Task Manager. Providing detail information and code helps a lot. Thanks!