0

There is a topic talking about best practic

https://github.com/grpc/grpc-go/issues/682

But I am not sure at last, How to use grpcio in my program.

I am using tensorflow-serving which is base on GRPC. My client is based on python sdk grpcio-1.8.3. The client program is a Flask server with many APIs each of them holds identical channel and stub.

When the tensorflow-serving(the GRPC server) restart, the client program will failed into "Endpoint read failed" and would not recover any more.

But when I upgrade the grpcio to newer version, The bug seems fixed, so that the client can reconnect automatically.

And if the grpcio client, namely the Flask server holds one channel and stub globally, the error seems never appears.

But I am still not sure what is the best way to program with grpc client SDK like grpcio, stable and high performance. Because there are even no exception testings on those examples, not to mention about how to use multiple channels and stubs in one process.

coder
  • 8,346
  • 16
  • 39
  • 53
Henry John
  • 89
  • 1
  • 9
  • `grpcio` package is now at v1.13.0 with 1.14.0 coming soon. v1.8.3 is an old release and a ton of bugs have been fixed since that release. – Mehrdad Afshari Jul 25 '18 at 17:51
  • Yes, We have updated grpcio to newer version, and the problem sloved. But I still care about how to program with it if I need multiple channels and stubs in one process. – Henry John Jul 30 '18 at 01:41
  • 1
    You can have multiple stubs on top of a single channel. Usually no need to create multiple channels to connect to a single server. You can freely share the channel across stubs with no issues. (You can also have multiple channels connected to a single endpoint too, of course.) – Mehrdad Afshari Jul 30 '18 at 06:43

0 Answers0