Questions tagged [grpc-python]

Python implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.

gRPC is an open source remote procedure call (RPC) system initially developed at Google. It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authentication, bidirectional streaming and flow control, blocking or nonblocking bindings, and cancellation and timeouts.

gRPC Basics - Python

401 questions
7
votes
2 answers

what is _MultiThreadedRendezvous in grpc and how to parse it

I'm trying to send a grpc request and I'm expected to receive stream of message back. Instead I'm receiving a response as <_MultiThreadedRendezvous object>. Can anyone help me to understand why I'm receiving this and what should I do to extract the…
rajesh
  • 79
  • 1
  • 5
7
votes
1 answer

Python GRPC Server performance bottleneck

I have written a grpc server that contains multiple rpc services. Some are unary and some are server side streaming. It connects to a grpc kubernetes server so I am using the python kubernetes client to query the server Currently I am having some…
Mark Estrada
  • 9,013
  • 37
  • 119
  • 186
7
votes
2 answers

handling async streaming request in grpc python

I am trying to understand how to handle a grpc api with bidirectional streaming (using the Python API). Say I have the following simple server definition: syntax = "proto3"; package simple; service TestService { rpc Translate(stream Msg) returns…
raduw
  • 1,008
  • 1
  • 9
  • 19
7
votes
1 answer

gRPC python client authentication example

How do you use the gRPC python auth library for both client and server authentication? The docs only cover server authentication. Are there additional flags in grpc.secure_channel() that need to be used?
maged
  • 859
  • 10
  • 24
6
votes
1 answer

Python gprc AttributeError: 'NoneType' object has no attribute 'message_types_by_name'

I just want to complete a simple demo, but I got this error message. Traceback (most recent call last): File "E:/grpc/biliService.py", line 10, in import hello_bilibili_pb2 as pb2 File "E:\grpc\hello_bilibili_pb2.py", line 21, in…
guandong lan
  • 61
  • 1
  • 2
6
votes
1 answer

Multi-thread support for python asyncio gRPC clients

I have an asyncio gRPC client that is used in a multithreaded environment. When multiple threads connect to the service via the client simultaneously, I see a stream of the following errors: 2021-01-27 09:33:56,937 ERROR [asyncio] [thread_0]…
Michael
  • 531
  • 1
  • 6
  • 11
6
votes
1 answer

Difference between `protoc` and `python -m grpc_tools.protoc`

To compile proto files for Python, I could protoc -I=.--python_out=$DST_DIR sommem.proto based on https://developers.google.com/protocol-buffers/docs/pythontutorial or python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=.…
zyxue
  • 7,904
  • 5
  • 48
  • 74
6
votes
3 answers

Python gRPC health check

I'm trying to learn gRPC and implemented the same code as in the tutorial. Wondering how to add gRPC health check to it. Stumbled upon this, but clueless on how to write a gRPC health check.
5
votes
4 answers

How to open a secure channel in python gRPC client without a client SSL certificate

I have a grpc server (in Go) that has a valid TLS certificate and does not require client side TLS. For some reason I can not implement the client without mTLS in Python, even though I can do so in Golang. In Python I…
prnvbn
  • 700
  • 2
  • 7
  • 25
5
votes
3 answers

Python grpc-tools is declared to be missing right after I installed it

I'm using the very latest Ubuntu 21.04 for aarch64. In order to experiment with gRPC, I installed grpc stuff: python3 -m pip install grpc python3 -m pip install grpcio-tools I also tried: pip3 install grpc pip3 install grpcio-tools These appeared…
Whuddawuh
  • 85
  • 1
  • 7
5
votes
1 answer

How to handle a bidirectional grpc stream asynchronously

I have a game or for that matter any remote user interface with a server and multiple clients which should communicate via network. Both client and server should be able to send updates asynchronously. This seems to be a very natural service…
dummy
  • 265
  • 3
  • 10
5
votes
3 answers

How to run grpc-gateway for python

I am grpc rookie and wanted to create a REST endpoint for health check of the grpc server. For this I decided to use grpc gateway. However, the example in docs for grpc-REST gateway for proxying grpc to json are only given for Golang. But I have a…
Shivansh Jagga
  • 1,541
  • 1
  • 15
  • 24
5
votes
1 answer

Performance Issue: Async gRPC with Gunicorn + Tornado

Background: We're trying to migrate our API Gateway from REST to gRPC. The API Gateway will consume by Backend Team with REST, and the communication from API Gateway to microservice will be using gRPC. Our API Gateway build with Tornado Python…
Kaslie
  • 543
  • 2
  • 9
5
votes
1 answer

What does 'option' keyword in a .proto file means?

I have a sample helloworld.proto file and use Python. I am not getting what does this option keyword has to do in the compilation phase? syntax = "proto3"; package services.helloworld; option go_package =…
Kishor Unnikrishnan
  • 1,928
  • 4
  • 21
  • 33
5
votes
0 answers

GRPC Python - What is the correct way to handle socket error?

The error : Rendezvous of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "Socket closed" debug_error_string = "{"created":"@1576780304.349820911","description":"Error received from peer…
GermainGum
  • 1,349
  • 3
  • 15
  • 40
1
2
3
26 27