Open ChristopherDavenport opened 5 years ago
http4s/http4s#2222 is prior art.
I don't want to block the release on this one. Demilestoning.
@rossabaker hi, Do you have an update on this? or maybe could you suggest the workaround, in case I want to stop accepting new connections and keep process all the unfinished requests. 😄
I have found it extremely difficult to implement this in blaze. I would still like it to have that feature, but am not currently actively working on it.
guys, how does this relate to this part of docs:
As a convenience, cats-effect provides an cats.effect.IOApp trait with an abstract run method that returns a IO[ExitCode]. An IOApp runs the process and adds a JVM shutdown hook to interrupt the infinite process and gracefully shut down your server when a SIGTERM is received.
from here: https://http4s.org/v0.21/service/
is the graceful shutdown implemented or not? :)
I'd say it's a misleading statement, because it's implementation dependent. IOApp
will await the finalizers of your composed resource, but the blaze-server does not yet await the drainage of all active connections in its finalizer.
Furthermore, blocking the finalizer as connections drain is not necessarily what a backend should do, because a lot of users may want to wait up to a fixed time, and then aggressively shut down the server.
i see ... do you know if other implementations do that? jetty for example?
We currently do not support graceful shutdown in blaze.
We would ideally prefer to have a graceful shutdown, and a time till a hard shutdown. @rossabaker has been working on it and can give more specifics.
Related to http4s/http4s#751