New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#3699] Nio|EpollEventLoopGroup.shutdownGracefully() needs to gracefully... #3706
Conversation
…lly close connections. Motivation: Currently when calling Nio|EpollEventLoopGroup.shutdownGracefully() all active Channels will be closed right away. This is not what should happen for a graceful shutdown. Modifications: Only close Channels after quite period is complete. Result: Correct behavior when call shutdownGracefully()
@trustin please check |
@Scottmitch also please check |
TL;DR - We don't need to fix this because it is working as intended. The intention of #3699 says the connections are closed before in-flight messages are handled. Actually, that's an intended behavior. Why? If we waited until all incoming messages are handled, it will always take as much time as the grace period, and we will still not be able to ensure all messages are handled. i.e. we solved nothing really. I think it's better for a user to communicate with the remote peers to schedule the shutdown and call /cc @fantayeneh |
@trustin true ... let me close as won't fix... |
@trustin I am still confused about The current doc says as follows.
Thanks |
To support graceful shutdown of applications, the usual workflow is as follows:
This enables blue-green type deployments to be easily put together. If I am reading @trustin's comment correctly, Is my understanding correct and if so, what would be the recommended way to gracefully stop a Netty based proxy which may have in-flight requests waiting for responses from downstream services before shutting down? cc @normanmaurer for insight (for context: we are trying to get clj-commons/aleph to do the right thing when closing down) |
Following-up here in case someone lands here. It seems that the best way to approach this is to keep track of connections with a |
... close connections.
Motivation:
Currently when calling Nio|EpollEventLoopGroup.shutdownGracefully() all active Channels will be closed right away. This is not what should happen for a graceful shutdown.
Modifications:
Only close Channels after quite period is complete.
Result:
Correct behavior when call shutdownGracefully()