>Does it really ? If some tomcat code is at that time processing a client POST >request, >which potentially modifies data on the server (or a back-end database), is >ditto tomcat >code "informed" of the JVM shutdown, and does it have time to interrupt the >processing in >some predictable/recoverable way ?
In no other way than a Tomcat worker get informed about a Tomcat shutdown if you trigger this event e.g. by the shutdown port mechanism or JXM. OT a feature of Tomcat is that it will first stop accepting new requests by the connectors and let the servlet containers stop the applications afterwards. Therefore, a started request will be finished. And after all request workers are idle, the worker pool will terminate. If you send a signal to a process, nothing is "interrupted" but just a consumer in the process get signaled - that's why it's called this way. And that's the reason why a process might not stop if you send a SIGTERM to it. It's just a request to please the process to terminate by itself. Some signals are handled outside the process, for simplification let's say by the process scheduler. If one send a SIGKILL, the scheduler will "hard kill" the process (and it's threads) at any point of execution path and just recover the reserved resources.