-----Original Message-----
From: Harris, Jeffrey E. [mailto:jeffrey.har...@mantech.com] 
Sent: Thursday, March 14, 2013 4:11 PM
To: Tomcat Users List
Subject: RE: Procrun and Tomcat service/OS shutdown on Windows



> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.koli...@gmail.com]
> Sent: Thursday, March 14, 2013 4:01 PM
> To: Tomcat Users List
> Subject: Re: Procrun and Tomcat service/OS shutdown on Windows
>
> 2013/3/14 Thomas, Steve <stho...@vocollect.com>:
> > Hi -
> >
> > Running Tomcat 7.0.23 or 7.0.37 (32 or 64-bit) installed as a 
> > service (either via service.bat or the exe installer) on a Windows 7 
> > 64-bit OS, we are seeing an issue where the Windows shutdown kills 
> > Tomcat before our webapp shutdown sequence has time to execute fully.
> > (Specifically, we just want to make sure our instance of HSQLDB 
> > shuts down correctly, otherwise corruption can ensue.)
> >
> > Details:
> >
> > Initially we were running with 32-bit Tomcat 7.0.23 and saw that our 
> > shutdown sequence was not being logged at all when one of our 
> > customers shut down his laptop.  It looked like the process was just 
> > being killed.  I found a commons-daemon/procrun bug and 
> > corresponding fix that seemed like it should address the issue, 
> > namely
> >
> > http://stackoverflow.com/questions/13578196/how-to-gracefully-
> shutdown
> > -procrun/14150785#14150785
> >
> > https://issues.apache.org/jira/browse/DAEMON-274
> >
> > I subsequently upgraded Tomcat to 7.0.36 (32-bit, zip) to get the
> updated commons-daemon (http://tomcat.apache.org/tomcat-7.0-
> doc/changelog.html), but to no avail.  I thought perhaps the 32-bit 
> Tomcat/64-bit OS might be a disconnect, so I installed the 64-bit 
> version, but got the same result.  In short, it looks like we're 
> either doing something wrong with our code, or there's a new wrinkle 
> in the OS-service handshaking, or the bug wasn't fixed 
> correctly...maybe in that order.
> >
> > Details below on how our code manifested the problem as well as 
> > other
> steps to reproduce.
> >
> > Our database shutdown code is located in the destroy() function of a
> class implementing org.springframework.beans.factory.DisposableBean.  
> I added a Thread.sleep(5 min) call to reproduce it on my machine.  As 
> long as I shut down the service through the Services panel on Windows, 
> the shutdown sequence fully executes (and takes 5 min, as expected).
> But if I just shut down Windows, the sequence is interrupted.
>
>
>
> 1. From the above I would say that is a Windows feature, that it does 
> not wait for service to shutdown properly.
>
> I'd look into Windows support and MSDN, whether it is a configuration 
> issue or something that be workaround by proper coding.
>

I proposed three options to Steve to change the Windows configuration to either 
allow more time, or to make Tomcat shutdown dependent on the database shutdown, 
or both.

> 2. On the "Shutdown" tab of the procrun service configuration dialog
> (Tomcat7w.exe) there is "Timeout" field.
>
> I have "0" (sec) there.

A good option, but it will not necessarily override the Windows default of 12 
seconds to shut down a service.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the 
addressee(s) named herein and may contain proprietary information. If you are 
not the intended recipient of this e-mail or believe that you received this 
email in error, please take immediate action to notify the sender of the 
apparent error by reply e-mail; permanently delete the e-mail and any 
attachments from your computer; and do not disseminate, distribute, use, or 
copy this message and any attachments.

---------------------------------------------------------------------

Sorry, Jeffrey -- and thanks for pointing out your suggestions again -- I only 
saw your topmost comment last time around establishing a dependency on HSQLDB.  
I will check out your other options.

Regards,

Steve
This message is intended only for the named recipient. If you are not the 
intended recipient, you are notified that disclosing, copying, distributing or 
taking any action based on the contents of this information is strictly 
prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to