Unhandle Exception come from Garbage Collection?

A

AdEast

I have a application with hundreds of http webrequest in each threads, and all http operations were handled in my code. I got unhandled exception which did not come from my code. I suspect it come from Garbage Collection. How to avoid it? Thanks.

Date and Time: 8/14/2012 6:16:39 PM
Machine Name: QA-WIN764

Exception Source: System
Exception Type: System.Net.WebException
Exception Message: The request was canceled
Exception Target Site: FindServicePoint

System.Net.ServicePointManager.FindServicePoint
: N 00325
System.Net.HttpWebRequest.FindServicePoint
: N 00224
System.Net.AuthenticationState.PrepareState
: N 00095
System.Net.AuthenticationState.ClearSession
: N 00041
System.Net.HttpWebRequest.ClearAuthenticatedConnectionResources
: N 00156
System.Net.HttpWebRequest.Abort
: N 00624
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem
: N 00067
System.Threading.ThreadPoolWorkQueue.Dispatch
: N 00490


6:16 PM - 8/14/2012
 
M

Marcel Müller

I have a application with hundreds of http webrequest in each threads, and all http operations were handled in my code. I got unhandled exception which did not come from my code. I suspect it come from Garbage Collection. How to avoid it? Thanks.

If you have Exceptions in the GC, then most likely you have a race
condition in one of your finalizers. The finalizers run in the context
of the GC thread.

But your call stack looks like an exception in an asynchronous method.
Either you started them explicitly or by the async keyword or by
parallel for or some algorithm like that. Maybe some framework
registered HttpWebRequest.Abort for you.


Marcel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top