• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tomcat Threads not closing on shutdown

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic