Fork me on GitHub
#pedestal
<
2023-07-25
>
Shekhar14:07:23

I am attempting to gracefully shut down the Pedestal server, and I have implemented a shutdown hook as shown below:

(.addShutdownHook (Runtime/getRuntime)
                  (Thread. (fn []
                               (timbre/warn "Shutting down the server")                       
                               (http/stop @server))))
I get below logs in the terminal when I press Ctrl + C
2023-07-25T13:13:00.471Z worf.local WARN [unifize.system:194] - Shutting down the server
2023-07-25T13:13:00.477Z worf.local INFO [org.eclipse.jetty.server.AbstractConnector:381] - Stopped ServerConnector@3b19d8ba{HTTP/1.1, (http/1.1, h2c)}{localhost:3592}
2023-07-25T13:13:00.479Z worf.local INFO [org.eclipse.jetty.server.handler.ContextHandler:1153] - Stopped o.e.j.s.ServletContextHandler@58bb05a9{/,null,STOPPED}
Upon initiating the shutdown, Jetty terminates active HTTP connections with the client. Is this the intended behaviour, or am I missing something?