We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue.
gRPC 1.7
go version
go version go1.9.5 darwin/amd64
MacOS Mojave 10.14
Use GracefulStop to stop gRPC Server. It blocks until all the pending RPCs are finished.
GracefulStop
However, if some RPC is abnormally pending for a long time, the server has to wait. Can I set timout for the GracefulStop?
The server can be stop by GracefulStop timeout, if some RPC is abnormally pending for a long time.
The text was updated successfully, but these errors were encountered:
This can be done by running GracefulStop in a goroutine, and do a select-wait on timer followed by a force Stop in the main goroutine.
Something like:
stopped := make(chan, struct{}) go func () { s.GracefulStop() close(stopped) } t := time.NewTimer(10 * time.Second) select { case <- t.C: s.Stop() case <- stopped: t.Stop() }
Sorry, something went wrong.
No branches or pull requests
Please answer these questions before submitting your issue.
What version of gRPC are you using?
gRPC 1.7
What version of Go are you using (
go version
)?go version go1.9.5 darwin/amd64
What operating system (Linux, Windows, …) and version?
MacOS Mojave 10.14
What did you do?
Use
GracefulStop
to stop gRPC Server. It blocks until all the pending RPCs are finished.However, if some RPC is abnormally pending for a long time, the server has to wait.
Can I set timout for the
GracefulStop
?What did you expect to see?
The server can be stop by
GracefulStop
timeout, if some RPC is abnormally pending for a long time.What did you see instead?
The text was updated successfully, but these errors were encountered: