Open joshua-classen opened 2 years ago
wtf xdddd its basically the same code https://github.com/dword-design/tree-kill-promise/blob/3d2ca856e1bc3d55d967d9a3eebd516615c086b2/src/index.js#L3
get the same problems, the java process somehow respawns as a standalone process.
await this.findAvailablePort(PRINT_SERVER_PORT); const childPrintProcess = child_process.spawn('cmd.exe', [ '/c', jrePath, '-jar', '-Dfile.encoding=UTF-8',
-Dserver.port=${this.availablePort}`,
'-Ddisable.waiter=merge_table,temp_dish,campaign_dish,old_combo,member_center,full_reduce,charge_quit',
'-Ddisable.link.upgrade=true',
printServicePath,
]);
this.printSocketProcess = childPrintProcess.pid;
// some thing treeKill(this.printSocketProcess, 'SIGKILL', resolve); `
I spawn a python Process in my Electron App. On the python process runs a Flask server. In my Electron App I spawn the Python process with
I later kill the process with
I can see in the
Process Explorer
from Microsoft that the tree also gets killed,but after a milisecond, the python process somehow respawns as a standalone process.If I kill the exact same process tree in the
Process Explorer
from Windows, then the tree gets killed and there is no crazy respawn of the python process. I don't know why its respawning with thetree-kill
module. Any Ideas?UPDATE I use now the module
tree-kill-promise
. https://www.npmjs.com/package/tree-kill-promise This worked for me.