Hi, I have an application that spawns worker threads and process files in the the worker threads. On application shutdown request, I want the application to shutdown only when the worker thread has finished processing the current file (if it is processing a file). I am using JavaServiceWarapper to manage my application.
I have added shutdown hooks that informs the worker thread not to start processing a new file when it gets a shutdown request.
Processing a file never takes more than 30 seconds and I have set the time outs to 60 seconds, just to be one safe side.
For some reason, when I trigger stop, my application shuts down immediately and doesnt wait for the worker threads to complete. The worker threads get the shutdown request but the application exits immediately (and doesnt wait for 60 secs)
Some of the important settings I have wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp wrapper.adviser=FALSE wrapper.debug=FALSE wrapper.disablerestarts=FALSE wrapper.jvmexit.timeout=60 wrapper.requestthreaddumponfailedjvmexit=TRUE wrapper.shutdown.timeout=60 wrapper.signal.mode.hup=FORWARD wrapper.startup.timeout=300 wrapper.usesystemtime=FALSE wrapper.ping.timeout=120
Can anyone help me with the mistake I am doing.