Skip to content

`Process.KillTree throws a lot of exceptions internally #121279

@Youssef1313

Description

@Youssef1313

I'm seeing a situation in microsoft/testfx repo where Process.KillTree appears to take so long.

Image

In the above case, the process itself has already exited before Kill(true) was called. Based on the code comment here:

// If the process has exited, the handle is invalid.
if (handle.IsInvalid)
return null;

I'm really surprised this condition isn't hit and we return immediately.
I guess it's not a supported scenario to kill whole tree if the parent process already exited?

Note: I haven't tried to create a minimal repro yet.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions