-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Graceful shutdown with bidirectional stream #2888
Comments
Not like this. The common way to shut down a server would be to do a graceful stop, sleep for some grace period, and then do a hard shutdown. After the graceful stop, no new RPCs will be accepted, so after the grace period, only longer-lived streaming RPCs should remain, which the hard shutdown will terminate.
No, there is currently no way for the client to know that the connection a stream is using received a GOAWAY. In general, the procedure I described above is used to handle these types of situations. Please let me know if you have any further questions. |
@dfawley Drawback is that some RPC calls may still be killed if they takes longer than grace period but it's still good idea to try. Thanks. Feel free to close this issue if you don't have any plans for graceful stop improvements. |
Number 2 is an interesting suggestion. Given that clients should always be resilient to network outages/server failures, this would be more of an optimization to help clients play along nicely with the server's graceful shutdown. As such, it would likely be a pretty low priority for us. Closing, but if you feel there is sufficient benefit to this feature, feel free to open a new feature request issue -- or it may be more appropriate to request it as a cross-langauge feature in the main grpc/grpc repo. |
I have bidirectional streaming endpoint with ping pong (server is sending message to client and client sends it back).
If I use
server.GracefulStop
server is never get killed since there is active stream. I see that go client receives GOAWAY.From what I see in the source code this works as expected and server is not killed if there is at least one active stream. My questions are:
Thanks.
The text was updated successfully, but these errors were encountered: