0

I have a Tomcat 9.0.0 on a Win7. And I have two ways to shut down the server:

  1. Hit Ctrl+C in the server console
  2. Run catalina stop command

Still I observe different behaviour - while first way successfully shuts down the second leaves server process alive (probably some unfinished threads in user code). So I wonder what is practical difference in these ways of shutting down, what's going on inside tomacat?

1 Answers1

1

Usually when doing Ctrl+C , Operating System sends kill signal for that process. It is forceful shutdown you may get some critical data lose or some resources are not cleaned properly, say Database connections, Thread local values etc.

When Running catalina stop command, all the resources are cleaned and closed gradually without any loss. Also If anything is registered using ShutDownHook, it also works fine.

Ramesh Subramanian
  • 944
  • 1
  • 12
  • 28