Graceful shutdown of embedded jetty

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Graceful shutdown of embedded jetty

Robert Sjödahl
Hi,

I have Restlet 2.3.12 setup with embedded jetty today. I want to have a graceful shutdown. That means that I would like to first send SIGTERM (i.e. kill) and then after a grace period send SIGKILL (i.e. kill -9). On the SIGTERM I want to stop accepting connections and only start handling the current connections. And at SIGKILL kill the application in total. Today from my tests SIGTERM will just kill the application.

I guess this can be down by adding a shutdown hook from Java and invoking a method on the wrapped server? 

But what is the preferred way to do this with Restlet and embedded Jetty?

Regards,
/Robert

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Graceful shutdown of embedded jetty

Robert Sjödahl
Hi,

After Restlet 2.4.1 Jetty has been updated to 9.4.x which is to support graceful shutdown. But there is an issue with that in restlet:
https://github.com/restlet/restlet-framework-java/issues/1333

Does anyone have a workaround for this?

Regards,
/Robert

On Friday, September 7, 2018 at 2:18:32 PM UTC+2, Robert Sjödahl wrote:
Hi,

I have Restlet 2.3.12 setup with embedded jetty today. I want to have a graceful shutdown. That means that I would like to first send SIGTERM (i.e. kill) and then after a grace period send SIGKILL (i.e. kill -9). On the SIGTERM I want to stop accepting connections and only start handling the current connections. And at SIGKILL kill the application in total. Today from my tests SIGTERM will just kill the application.

I guess this can be down by adding a shutdown hook from Java and invoking a method on the wrapped server? 

But what is the preferred way to do this with Restlet and embedded Jetty?

Regards,
/Robert

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].