We’re running a web service as a web site project. Clients make requests which return after a few seconds, but which spawn a thread that should run for hours. The thread makes web requests and writes to a database, and is throttled with Thread.Sleep calls.
After running for about 20 minutes with several threads running, all the threads receive a ThreadAbortException at the same time. Thread.resetAbort doesn’t help. The exception can occur during a SQL call, during a web request or during a Thread.Sleep.
I thought the problem might be the httpRuntime attribute executionTimeout in web.config, but that didn’t solve the issue.
Any other ideas what might be killing off all our threads?
The application pool in IIS has an idle time-out. It needed to be turned off.
(Administrative Tools > IIS. Right-click the application pool > properties. Performance tab.)