-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
GracefulStop doesn't wait for RPC to finish #1110
Comments
Ah. This is because the main goroutine is exiting when I'll close this, since it doesn't seem to be a bug. |
For posterity, here's how I fixed my example app. |
@mastahyeti how does it fix your issue? I've just cloned your repo with the fix, and the client is still getting |
It looks like the behavior was changed in #1485. Maybe there's a regression in how clients deal with the server closing. |
I think it's possible that's #1738. |
This is finally fixed in #1734 |
I don't think this is a duplicate of #848, so I'm opening a new issue.
I'm trying to figure out how to gracefully shutdown my GRPC server so RPCs aren't cancelled during server deployments. From reading the docs, it sounds like I want
func (*Server) GracefulStop
, but in practice it seems to cancel in-flight RPCs.I'm testing this by triggering a
GracefulStop()
while the server is processing a long-running RPC (sleeping). This is being output to stderrand the client is receiving this error:
rpc error: code = 13 desc = transport is closing
Am I doing something wrong, or is this a bug?
I threw together an example server/client to demonstrate this behavior: https://github.com/mastahyeti/grace
Thanks.
The text was updated successfully, but these errors were encountered: