-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
What version of gRPC-Java are you using?
On a fork up at commit d168632
What is your environment?
Mac OSX 10.14.6
Java 11.0.2
What did you expect to see?
The server should allow in-flight RPCs to finish
What did you see instead?
The client receives error WARNING: RPC 1 failed: Status{code=UNAVAILABLE, description=Network closed for unknown reason, cause=null}
Steps to reproduce the bug
- Add a call to
Thread.sleep(15000)
inio.grpc.examples.helloworld.HelloWorldServer.GreeterImpl.sayHello
- Build and run the server
- Run the client
- Ctrl+C the server once it gets the request
It seems like server.shutdown()
does not wait for in-flight RPCs to finish before returning. The documentation makes it seem like that it should block.
I am able to "fix" the issue by adding a call to server.awaitTermination()
in the stop
method.
leosurwiki and chenjiang1985