The following code gets the application pool name answering the request:
Try
lcVirtualDirectory = AppDomain.CurrentDomain.FriendlyName
lcVirtualDirectory = Mid(lcVirtualDirectory, 5)
lcVirtualDirectory = Mid(lcVirtualDirectory, 1, oApp.RAt("-", lcVirtualDirectory) - 1)
lcVirtualDirectory = Mid(lcVirtualDirectory, 1, oApp.RAt("-", lcVirtualDirectory) - 1)
lcVirtualDirectory = "IIS://localhost/" + lcVirtualDirectory
loDirectoryEntry = New System.DirectoryServices.DirectoryEntry(lcVirtualDirectory)
lcApplicationPool = loDirectoryEntry.Properties("AppPoolId").Value.ToString
Catch loError As Exception
End Try
Anyone would see something in there which could freeze on a line and not answering from there after?
There was a situation this morning and I would just like to verify this code just to make sure it wasn't a factor.
That code is executed only on IIS recycle, we have put it at 06h00, and only if I send a new compilation. I have four application pools. So, the first hit of each application pool will execute this code to get the application pool name which is then used to log a record in my IISApplicationCycle table.
It would really surprise me this could be related. But, I thought I would check.
This code performs well since a while on various environments. But, this morning, only two application pools recycled. The other two locked themselves at the CPU level and a brut force to reset them was necessary as all incoming hits forwarded to those two application pools, not responding, were lost.
Usually, at 06h00, or when I send a new compilation, all four application pools load ok.
The server is being known to be in a not-fully-stable environment as we need to find one last issue that the CPU is not performing as it does on other servers with clone copies. So, I am wondering if this is related to that CPU issue or else.