Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hi All,

Yesterday we encountered a strange exception on our Production server when the number of the users were (Load) was getting increased (Approx 200+ users).

Exception message on the web server where the webservice is deployed in event viewer - application logs section:

ISAPI 'c:\winnt\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'.

After going through the blogs on google, we belive it could be some threading issue on the App Pool. Somehow, the thread pool in the IIS 6 is gettign full and throwing exceptions. WE did not experience the same error in UAT / SIT environments.
However, some of the blogs are misleading and creating confusions.

If anyone has encountered the above exception, please share the real root cause and solution for the aforemetioned exception.

Workaroudns tried:
1. Rebooting the web server.
2. Reset IIS.
3. reating new App Pool (Yet to figure out).

How to increase the thread pool capacity in IIS 6? Or any other workaround?


Please Help and Thanks in advance !!

Thanks, Tapas
"Happy Coding"
Posted
Comments
Sergey Alexandrovich Kryukov 29-Apr-14 2:18am    
Not enough information. Without seeing your code, it's hard to say how you managed to cause deadlock. You can read about deadlocks and deadlock detection methods (first topic is commonly known but very non-trivial in general case, the second topic is extremely difficult). In your case, it could be something extremely simple.
—SA
TapasU 29-Apr-14 3:35am    
Hey, the thing is.. we are able to figure out becaue of which code it is getting failed. Though I can share a sample piece of code which we are suspecting.
This is the Startup code

Thread threadInitializeService = new Thread(InitializeMyWebService);
threadInitializeService.Name = "thread-InitializeMyWebService";
threadInitializeService.Start();

private void InitializeMyWebService()
{
var threadId = Thread.CurrentThread.ManagedThreadId;
Service webService= new Service();
webService.TargetWebServer = "http://MyProdServer/MyVirtualDirectory/Service.asmx";
webService.PreAuthenticate = true;
webService.Credentials = System.Net.CredentialCache.DefaultCredentials;
}
TapasU 29-Apr-14 3:36am    
We are initializing the service instance in one seperate thread, Could this piece of code could create the exceptions??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900