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

ProcessExecutionTimeout leaves child processes after timeout #1305

Open
ElijahReva opened this issue Dec 19, 2023 · 0 comments · May be fixed by #1306
Open

ProcessExecutionTimeout leaves child processes after timeout #1305

ElijahReva opened this issue Dec 19, 2023 · 0 comments · May be fixed by #1306

Comments

@ElijahReva
Copy link
Contributor

ElijahReva commented Dec 19, 2023

Usage Information

Any

Description

Process execution timeout does not kill the whole process tree. My use case is the timeout for the "dotnet test". This process spawns the child process; when timeout happens, only the main process is killed.

Reproduction Steps

running dotnet test for net4.8 framework; Add Thread.Sleep in tests more than and Timeout in nuke build; After timeout observe orphan processes left in "procexp" tool

Expected Behavior

No orphan processes are left

Actual Behavior

Only the parent process is killed

Regression?

Nope.

Known Workarounds

netstandart2.0 examples

https://github.com/dotnet/msbuild/blob/vs15.9/src/Utilities/ProcessExtensions.cs
https://raw.githubusercontent.com/dotnet/cli/master/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/ProcessExtensions.cs

Latest Microsoft solution
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.kill?view=net-8.0#remarks

Could you help with a pull-request?

Yes

@ElijahReva ElijahReva added the bug label Dec 19, 2023
@ElijahReva ElijahReva changed the title ProcessExecutionTimeout leaves child processes after timout ProcessExecutionTimeout leaves child processes after timeout Dec 19, 2023
@ElijahReva ElijahReva linked a pull request Dec 19, 2023 that will close this issue
@matkoch matkoch added enhancement and removed bug labels Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants