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

SilentProcessRunner could hang while waiting for a zombie process on Windows #8043

Closed
1 task done
akirayamamoto opened this issue Feb 17, 2023 · 2 comments
Closed
1 task done
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving

Comments

@akirayamamoto
Copy link

Team

  • I've assigned a team label to this issue

Severity

No response

Version

Present on 2022.2.704

Latest Version

I could reproduce the problem in the latest build

What happened?

Octopus Server uses the SilentProcessRunner class to invoke external processes.
If this external process hangs the cancellation token should be requested at one point which should terminate the execution. If this external process becomes a zombie after trying to terminate it SilentProcessRunner will wait for the zombie process to finish even though the cancellation token has been requested.

Reproduction

N/A

Error and Stacktrace

Failed to kill the launched process and its children: System.ComponentModel.Win32Exception (5): Access is denied.
   at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.Kill()
   at Octopus.Shared.Util.SilentProcessRunner.Hitman.TryKillWindowsProcessAndChildrenRecursively(Int32 pid) in ./source/Octopus.Shared/Util/SilentProcessRunner.cs:line 562
   at Octopus.Shared.Util.SilentProcessRunner.Hitman.TryKillWindowsProcessAndChildrenRecursively(Int32 pid) in ./source/Octopus.Shared/Util/SilentProcessRunner.cs:line 542
   at Octopus.Shared.Util.SilentProcessRunner.Hitman.TryKillWindowsProcessAndChildrenRecursively(Int32 pid) in ./source/Octopus.Shared/Util/SilentProcessRunner.cs:line 542
   at Octopus.Shared.Util.SilentProcessRunner.Hitman.TryKillProcessAndChildrenRecursively(Process process) in ./source/Octopus.Shared/Util/SilentProcessRunner.cs:line 510
   at Octopus.Shared.Util.SilentProcessRunner.DoOurBestToCleanUp(Process process, Action`1 error) in ./source/Octopus.Shared/Util/SilentProcessRunner.cs:line 478

More Information

No response

Workaround

No response

@akirayamamoto akirayamamoto added kind/bug This issue represents a verified problem we are committed to solving state/triage labels Feb 17, 2023
@akirayamamoto akirayamamoto self-assigned this Feb 17, 2023
@octoreleasebot
Copy link

octoreleasebot commented Feb 22, 2023

Release Note: Fixed an issue where SilentProcessRunner could hang while waiting for a zombie process to finish on Windows.

@Octobob
Copy link
Member

Octobob commented May 19, 2023

🎉 The fix for this issue has been released in:

Release stream Release
2023.2 2023.2.1217
2023.3+ all releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

4 participants