Rıfat Erdem Sahin
Rıfat Erdem Sahin

Reputation: 1778

What happens with an exception in Asp.Net with concurrent users

Does it cause all the threads,I mean all the users to stop and increase the wait time http request queue and start to affect the availability of the application ?

If so should we make sure there is no exception left over in an asp.net application to ensure scalability of the application.

Upvotes: 3

Views: 204

Answers (2)

Erkan Demirel
Erkan Demirel

Reputation: 4382

Some unhandled exceptions can terminate w3wp.exe. Therefore, you should handle exceptions. Application_Error can't handle which are thrown on another thread (background workers, fire and forget taks). You should use http module for these kind of errors. But it also can't catch stackoverflow erros. You should use some decarations for this, if you want handle exceptions on Application level. Here is more detail.

Other than this I think exceptions will not effect the other users. Exception and performance.

Basically, exceptions shouldn't happen often unless you've got significant correctness issues, and if you've got significant correctness issues then performance isn't the biggest problem you face.

I liked this sentence :)

Upvotes: 1

Win
Win

Reputation: 62260

Does it cause all the threads,I mean all the users to stop and increase the wait time http request queue and start to affect the availability of the application

It depends on the exception. For example, OutOfMemoryException will affect all users.

On the other hands, FileNotFoundException wouldn't affect other user.

If so should we make sure there is no exception left over in an asp.net application to ensure scalability of the application.

Well, we all developers try to write bug free code, but sometimes things slip out of our hand. It is why we use logging to catch run-time exceptions - such as Log4Net, NLog.

Upvotes: 0

Related Questions