I decided to work on something simpler than our real application, so I used this template app:
I made a couple of minor changes:
- Make one endpoint return slowly by adding a call to Future.delayed(Duration.fromSeconds(30)) in the controller
- Set a default close grace period of 60 seconds in the Server implementation
If I use the admin shutdown endpoint, the server shuts down gracefully after all request are complete.
If I send SIGTERM to the server process, the server shuts down even if requests are in progress.
Is this the expected behaviour?
Is there a way to persuade finatra to shutdown more gracefully on SIGTERM?
Thanks,
Dave