[Opensource] graceful shutdown vs. threads
Michael Rimov
rimovm at centercomp.com
Wed Jul 10 21:25:04 PDT 2002
At 11:27 AM 7/10/2002 -0700, you wrote:
>if your servlet has threads, there can be problems with
>shutdown. destroy() should set stop flags, interrupt, and otherwise stop
>all threads.
>
>what threads are in Expresso? the Job handler has thread(s), and I see
I attempt to perform proper shutdown by calling interrupt() for the job
handler and exiting at that point. Jobs themselves probably will have to
finish before they shut down.
>DelayThread has one (why not just use Thread.sleep() there?).
Actually, it has a queuing affect. If you have systems attempt to bombard
you with brute force password guessing attempts, the wait for the response
time will significantly increase, while still allowing the legitimate
requests proceed. That's the idea anyway.
>why does DBConnectionPool implement thread? it doesn't override run().
Good question... may be historical before my time.
>are all of threads handled properly in destroy()?
Check the initServlet.destroy() and you'll see what I've done to work with
this.
Any testing and work to further improve it and I'd be grateful. It would
greatly assist with webapp reloading.
Thanks!
-Mike
More information about the Opensource
mailing list