A way to graceful shutdown a process chain #5063
Comments
Options so far:
cc @davidfowl |
This is a much broader issue. If you do "dotnet run" and kill the process from Task Manager, you have the same issue. Maybe corehost should watch for the parent? |
I have to mark this as blocking. Our tests fail because there are processes left orphaned and subsequent compiles fail. |
Removing the blocking flag. We found a workaround using |
@stephentoub new API? |
@anurse @livarcocc wasn't there a discussion on how to solve this? |
There's a workaround by invoking taskkill/pkill but it's hacky and it doesn't work everyone. For example nano server doesn't have |
|
Just found out that |
@victorhurdugaci did you make any progress in solving this issue? cc @Sridhar-MS is hitting a similar issue |
I ended up writing a helper that kills a process tree. Not the perfect solution but it works for us. https://github.com/aspnet/Common/blob/dev/src/Microsoft.Extensions.Process.Sources/ProcessHelper.cs#L22 |
/cc @livarcocc |
It doesn't look like there is any remaining CLI work being tracked in this issue. |
@piotrpMSFT What's the recommended way of doing this? (Killing a whole process tree, cross platform) |
@muratg I'm wondering the same... Have you got an answer? Would be nice to have an xplat process management API. |
There's now a Process.Kill() overload for terminating the entire process tree. |
@bgribaudo perfect! Thanks! |
dotnet run
creates 2 processes: (1)dotnet
and (2) the app being run.If you kill
dotnet
the app being run (the exe) is orphaned.For
dotnet watch
we need a way to tell the parent process to terminate the child processes before exiting.Not sure if this should be addressed at the CLI level, or lower..
cc @piotrpMSFT
The text was updated successfully, but these errors were encountered: