468,272 Members | 2,025 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

Long running Clean Up task in Global.asax Application_End()

Hi All,

I have an asp.net web application that needs to clean up some worker
threads on application shutdown. These threads are emptying an in
memory buffer of messages to disk.

Basically I want these threads to empty any remaining messages to disk
before exiting.

To do so, I'm calling a clean up method in Application_End()

To test the cleanup methods, I stop IIS using CMD: "IISRESET /stop"

Most of the time this works fine, the threads complete cleanup in time.
However sometimes the cleanup task takes a while to complete. In this
case IIS seems to forcefully shutdown killing the worker threads before
they can finish emptying their buffers.
So in essence I have the following questions:

1.What is the timeout IIS allows for calls to me made in
Application_End() before it forcefully exits? and is there a way to
extend this timeout?

2.Is Application_Disposed() a better place to be doing this kind of
cleanup work? And if so what is the difference in function to
Any help is greatly appreciated, I fear that if this application
becomes very busy, in memory data may be lost on shutdown.

Thanks in advance.

Kind regards,
Andrew Stone.

Nov 28 '05 #1
0 1077

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Craig | last post: by
3 posts views Thread by Jim Owen | last post: by
6 posts views Thread by Andrea Williams | last post: by
2 posts views Thread by PRTC | last post: by
9 posts views Thread by tshad | last post: by
6 posts views Thread by Chase | last post: by
1 post views Thread by PadovaBoy | last post: by
1 post views Thread by sai | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.