You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to have a future for each request that has received headers but is yet to be finished?
I want to be able to wait on these when I stop the server rather than waiting an arbitrary amount of time hoping that all current requests finish in that time.
The text was updated successfully, but these errors were encountered:
This is something you could build at the application layer - either in an override of prepare() and on_finish or wrapping your Application and implementing the HTTP delegate interfaces. But I think just exposing Futures would be awkward to use and may not solve the problem - it doesn't on its own prevent new requests from coming in. For something built-in I think it would be better to add an explicit graceful drain mode that would stop the server from accepting new connections.
However, I'm a strong advocate of time-based shutdown mechanisms instead of trying to track open requests. I give my logic in #1791 (comment). I'm going to mark this as a duplicate of #1791 since that's the main issue we have tracking graceful shutdown discussions.
I agree with waiting a timeout, my problem is I want to quit earlier if there's no requests left and it felt hacky to have to subclass my handlers and add this kind of code and use the subclass instead.
I'll stick with timeouts then. thanks :)
Also, I was under the impression that http_server.stop() already stops accepting new connections (and the way we deploy in kubernetes means it won't get new requests at that point anyway)
Hello,
Is it possible to have a future for each request that has received headers but is yet to be finished?
I want to be able to wait on these when I stop the server rather than waiting an arbitrary amount of time hoping that all current requests finish in that time.
The text was updated successfully, but these errors were encountered: