I am trying to use the graceful shutdown of HttpServer server for http4k, using HttpCore 4.4.13 and 5.0.1. I am creating the server simply using `ServerBootstrap.bootstrap().register(...).create()` and shutting down with `shutdown(5, TimeUnit.SECONDS)` and `close(CloseMode.GRACEFUL)` respectively. Here is what I am seeing:

- When the server has never been requested it shuts down instantly ✔️ - When the server has been requested by a client without keep-alive it shuts down instantly ✔️ - When the server has been requested by a client with keep-alive and the request is in-flight during shutdown it shuts down as soon as the request is done ✔️

The problem is, when I connected with a client that uses keep-alive, and the request has been handled by the server and now the client is holding the connection open, then when I shutdown the server, the server will take the whole grace period to shutdown at which point the keep-alive connections are finally being force-closed.

Is it possible to somehow speed up the shutdown also in this case without terminating in-flight requests? Is there maybe a workaround to terminate all idle connections with keep-alives immediately before shutdown?

Kind regards
Niklas Lochschmidt


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to