in order to have a clean shutdown, i have added a ServletContextListener to
the web.xml, which, if contextDestroyed is executed, calls a shutdown
procedure (which i also have added as a shutdown hook to the JVM). For
example, there is an ExecutorService, whose running tasks need to stop
theirselves and it can take some time.
For a clean shutdown i do usually need around 5 seconds.
But with Resin 2.1.17 i am not given such an amount time. If i do a
httpd.sh, i have around 1 second, before the JVM vanishes.
My workaround at the moment is, that the app creates a special run file,
when it runs and removes, when it stops. It also checks periodically on the
existance of a stop file. If it exists, the application shuts down (and
removes so the run file, when stopped).
Then i have patched the "wrapper.pl" script, which creates that special stop
file, when the command "stop" is called. Right after that it waits for the
application shutdown with waiting, that the run file of the app disappears.
If it disappears or the maximum wait time is over, it sends SIGTERM
I wonder, if you have a better solution for Resin 2. What i dont like about
the solution at all, is that i stop the application, but Resin still thinks,
it is alive and will so allow requests to it.
What do you think? Beside sending me to Resin 3 again. ;-)
View this message in context:
Sent from the Resin mailing list archive at Nabble.com.
resin-interest mailing list