Skip to content
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

Remove pgrep dependency from KillTree implementation #6086

Open
tmds opened this issue Jan 26, 2021 · 3 comments
Open

Remove pgrep dependency from KillTree implementation #6086

tmds opened this issue Jan 26, 2021 · 3 comments
Labels
bug help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. triaged
Milestone

Comments

@tmds
Copy link
Member

tmds commented Jan 26, 2021

KillTree has a dependency on pgrep:

var exitCode = RunProcessAndWaitForExit(
"pgrep",
$"-P {parentId}",
out string stdout);

This means it can't work on systems which don't have this tool installed.

dotnet-watch has a similar dependency which causes it to fail in certain container images: dotnet/aspnetcore#27950.

cc @Forgind

@tmds tmds added bug needs-triage Have yet to determine what bucket this goes in. labels Jan 26, 2021
@Forgind Forgind added this to the Backlog milestone Jan 27, 2021
@Forgind Forgind removed the needs-triage Have yet to determine what bucket this goes in. label Jan 27, 2021
@Forgind Forgind added the help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. label May 11, 2022
@JaynieBai
Copy link
Member

Should we try catch exceptions here?

@rainersigwald
Copy link
Member

@JaynieBai looks like the trend in this file is to catch + ignore exceptions:

catch (InvalidOperationException)
{
// The process already exited, which is fine,
// just continue.
}

@Forgind
Copy link
Member

Forgind commented Nov 28, 2022

I think the ideal solution here, rather than just catch and ignore an exception, is to find a suitable replacement for pgrep. We still want the process and all its descendants to die; we just can't rely on pgrep to exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. triaged
Projects
None yet
Development

No branches or pull requests

5 participants
@tmds @rainersigwald @Forgind @JaynieBai and others