Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

tomcat Threads not closing on shutdown

 
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


 
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!

 
Saloon Keeper
Posts: 22289
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
    Bookmark Topic Watch Topic
  • New Topic