choco icon indicating copy to clipboard operation
choco copied to clipboard

Detect if a process has stopped responding

Open ferventcoder opened this issue 10 years ago • 5 comments

ferventcoder avatar Nov 20 '15 00:11 ferventcoder

Hi there, I'd like to work on this if possible or not taken up by someone else

FrancisChung avatar Jan 24 '24 02:01 FrancisChung

This has the 'Up For Grabs' labels so PR's are welcome. To set expectations, any PR received will go through a slower-than-we-would-like-process of review. Please bear with us.

pauby avatar Jan 24 '24 17:01 pauby

I was wondering what "a process" here in this context? Is this a process chocolatey has spawned, or chocolatey itself? When would this functionality be used to detect if a process is not responding?

FrancisChung avatar Feb 07 '24 03:02 FrancisChung

Those is 8 years old, so I'm guessing.

I would think that's when Chocolatey CLI runs an installer through the usual PowerShell helper functions, including Start-ChocolateyProcessAsAdmin, that it detects when a process its spawned, has stopped responding.

pauby avatar Feb 07 '24 09:02 pauby

Hey @pauby , thanks for coming back to me.

I picked this bug thinking it was a C# PR I could do (as part of a job interview), but it looks like the solution needs to be in Powershell.

Unfortunately, that's not a skill I can demonstrate for the job interview, but as part of my research into this issue I did discover a way to detect whether a process is hung in Powershell. And it seemed more robust than the C# solutions I had in mind.

So if someone would like to take over and do the powershell solution, there's a ready made solution here to implement and test. https://www.hurryupandwait.io/blog/detecting-a-hung-windows-process

FrancisChung avatar Feb 09 '24 00:02 FrancisChung