One of my script hangs during one of our product installation. Hangs is happening while executing some of the common PowerShell and native ExEs from PowerShell.
more details in below question which is actually in WindowsServer general Forums.
we use msdeploy,iisreset,appcmd here during web packages installation, this is the place where it hangs, but hang happens after successful execution of msdeploy.exe. I tried using latest available version of msdeploy, is still hangs some times.
We have around 7 web packages, hang happens after deploying a package as well as before deploying a package.
Code logic here.
Step 1: Test msdeploy exists, if not install it
Step 2 : iisreset (hangs here sometimes)
Step 3 : check if the app pool is available, if so Stop-WebAppPool (hangs here sometimes)
Step 4: install web package using msdeploy
Step 5: get the app pool state and start if it is not started – (some times hangs here)
Step 6: do some app pool settings using appcmd.exe (hangs some times after this execution)
Step 7: some other app pool settings like Set-ItemProperty IIS:\AppPools\$appPoolName -Name recycling.periodicRestart.memory -Value $appPoolRestartMemory
Step 8 : get the next package and go to Step 1
Sometimes, hang happens after executing
Note: None of the hangs are consistent, each and every time, hang happens in either one place.
I did procdump analysis of the powershell process and ended up in ntdll!ZwWaitForMultipleObjectsroutine for all hangs.
same is being shown by the proc explorer threads view as well.
PFB the hanging handle's stack
Any help is appreciated a TON.
Unfortunately, without any consistency, and the fact that you're not actually experiencing a hang in PowerShell itself, this is going to require a much deeper level of debugging than I think I can get into here. I'd have to pull out my low-level process monitors, hook the suspected processes, and really look at their stack traces. That's far, far, far outside the world of "PowerShell," though.
Thanks a lot Don,
I have the process dump of the hung PowerShell, If available, can you suggest that "low level process monitors" for me to dive in.
One more point to highlight is, all the hangs are happening during actions which are directly or indirectly related to IIS(msdeploy,iisreset,netsh http delete urlacl url=$url,appcmd and WebAdministration cmdlets).
You must be logged in to reply to this topic.