Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Specific Graceful Shutdown Algorithm

Hiya,

I'm looking to implement a graceful shutdown algorithm from inside a hosted WAR (i.e. not an embedded Jetty project) that looks like this...

1. trap a kill signal
2. stop accepting new connections (to the entire container is fine although it might be interesting to explore to-a-single-servlet)
3. wait indefinitely until the current connection count drops to zero
4. exit

As it happens, I'm already counting the connections I care about using a scala Actor but I'm having a really hard time working out which thing's static method gives me access to the container / server as a whole and will allow me to build the behaviour I describe. I recognise that the graceful interval config option exists but is this the appropriate thing to use given...

1. I want to wait for connections to finish for an indefinite period
2. I potentially only want to take account of the connections to certain servlets (this is not a deal breaker - just a potential nice-to-have)

Note all of this is as a result of really bad experiences using hot deploy. Yes - I have learnt my lesson and will never use it in production again ;-)

Cheers,

Andre

--

...and, on the seventh day, God switched off his Mac

...and then read http://www.prfsa.com



Back to the top