Click here to Skip to main content
15,917,565 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I have a page that sends 4 Async Pings per device, and works well for the most part. However, due to timeout, when many of these devices are offline - ASP.NET stops responding for the entire Web App (not only this page), and I get an W32SVC error:

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

http://support.microsoft.com/kb/821268[^]

When all devices are online - no crash occurs, only when majority are offline, and each Async Ping needs to wait for a timeout. I believe what is happening here is too many worker threads are being created, and this is crashing IIS. Does any one have any suggestions on a way to resolve this? I have already tried the recommended settings in machine.config from the microsoft site, and that doesn't seem to help.
Posted

1 solution

You can lower the timeout for the Ping.SendAsync to maximum 1000 ms and perhaps lower the maximum TTL to 10.

And perhaps you should limit number of simultaneous Ping.SendAsync commands to 10 max. And when they get completed take the next 10 and so on?

I think you use all available thread in the ThreadPoll, and there by making a deadlock. The IIS then then take action to stop the deadlock and terminates your program.
 
Share this answer
 

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