-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to kill a running process #1494
Comments
Close ought to kill it. And #1 should be true too. I think these are expected behavior. |
import { run } from "deno";
const justAMinute = run({
args: ["python", "-c", "from time import sleep; sleep(60);"]
});
(async () => {
// 5 seconds
await new Promise(res => setTimeout(res, 5000));
// justAMinute.close();
})();
// python is still running This stemmed from this close in the deno_std test not cleaning up the file_server. Which I can also still replicate.... Could this be that the .close is not waiting for the response? It's weird as in the example above adding the close does work as expected. Note/Aside: If you |
I wonder if std::process::exit is the issue and we're not calling all the destructors.
From the documentation it reads like this ought to be dropped (and closed). This seems similar to #1517 cc @kevinkassimo .... |
It’s likely that we need to create a “process group” and stick all child processes in there (it’s a posix thing). |
@hayd I'll also investigate. Thanks for pinging me |
@hayd any update on this? |
Sorry... Working on this (seems easy enough to fix) |
Hmm I have just tested, it seems that the example @hayd provides is working now with latest release... |
There doesn't seem to be a way to kill a process initiated by
run
.close
only removes it from the resources list.A running process continues after the original deno application is complete.
A few options:
I favor 1+2.
The text was updated successfully, but these errors were encountered: