ASP.NET 2.0 website receives ThreadAbortException
We use a web service as a website design. Clients make requests that return after a few seconds, but which spawn a thread that should run for several hours. The thread executes web requests and writes them to the database and fades out with calls Thread.Sleep
.
After starting for about 20 minutes, when multiple threads start, all threads receive at the same time ThreadAbortException
. Thread.resetAbort doesn't help. An exception can be thrown during a SQL call during a web request or during Thread.Sleep
.
I thought the problem might be an attribute httpRuntime
executionTimeout
in web.config, but that didn't solve the problem.
Any other ideas that might kill all our threads?
source to share
I would assume the web app owns the thread and the app shuts down after a while.
If I was building something like this, I would write web services that handle your client requests and put them into a database, then I would write a Windows service that polls this database for client requests and spawns threads that do what you need (makes web requests and writes to the database). It sounds like you are writing some kind of cpu engine and I don't think an asp.net application is a good place to host this kind of thing.
source to share