• Post Reply Bookmark Topic Watch Topic
  • New Topic

tomcat Threads not closing on shutdown  RSS feed

 
Renz Alexander
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So when Shutting down my tomcat(embedded) server i checked with stack and saw that each time i stopped the server instance some threads are not closing specifically "http-8080-Acceptor-0" and "http-8080-AsyncTimeout". I'm worried that this would cause the server to pergem so can anyone help?

here's the stack for the two threads


 
Gabor Csepregi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I know it's an old thread, but I've just come to the same problem while embedding tomcat 7.0.4. When sending shutdown signal, or calling server.stop() everything is shut down as expected except the two aforementioned threads. When I shut down my whole java app, they quit as they're daemons.

But I would like to be able to completely shut down embedded tomcat and start another instance without quitting my app.

Is it possible?

In the tomcat changelog I found the following:

fix Make sure acceptor threads are stopped when the connector is stopped. (markt)
fix Make sure async timeout thread is stopped when the connector is stopped. (markt)


Does this mean that this problem is solved? Then why is it happening to me?

Thanks in advance!

 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like there may have been a bug, although I think it was the opposite problem to what you're having (shutting down too soon),

You cannot shut down Tomcat while keeping the webapp running because Tomcat is the container for the webapp, and when Tomcat shuts down, the entire Tomcat JVM shuts down.

However, barring Tomcat bugs, the normal shutdown process will shutdown all the Tomcat-spawned threads. So the normal cause of a "hang" on Tomcat shutdown isn't Tomcat, it's failure for one or more of the webapps to shutdown cleanly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!