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
21
votes
1 answer

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE

I have written a simple GRPC service, client code in python. Sometimes out of nowhere, the client fails with the following error: Traceback (most recent call last): File "grpc_client.py", line 35, in response =…
Zabir Al Nazi
  • 10,298
  • 4
  • 33
  • 60
21
votes
3 answers

Python not able to connect to grpc channel -> "failed to connect to all addresses" "grpc_status":14

I'm getting the error below when trying to call a stub method. Any idea what is causing it? [bolt.api.handlers] 2019-08-21 20:07:57,792 ERROR handlers:1066: 'ResourceHandler' object has no attribute 'ontology_service_handler' Traceback (most…
Yonoss
  • 1,242
  • 5
  • 25
  • 41
16
votes
0 answers

How is a gRPC queue managed? is there a size limitation for a gRPC queue?

I am trying to understand how gRPC queues are managed and if there are any size limitations on gRPC queue size. According to this SO post requests are queued: If your server already processing maximum_concurrent_rpcs number of requests…
honor
  • 7,378
  • 10
  • 48
  • 76
13
votes
1 answer

Grpc not increasing max size of the message: received message larger than max

I am using grpc to send some pretty large messages (the parameters of a machine learning model over the network). The problem is that I am getting the following error when I make a grpc call: grpc: received message larger than max (261268499 vs.…
MUAS
  • 519
  • 1
  • 7
  • 20
12
votes
2 answers

Google cloud storage python client AttributeError: 'ClientOptions' object has no attribute 'scopes' occurs after deployment

I am using cloud storage with App Engine Flex. Out of the blue i start getting this error message after deploy succeeds The error is happening from these lines in my flask app. from google.cloud import storage, datastore client =…
12
votes
3 answers

Why multiprocess python grpc server do not work?

I instantiate one grpc server per subprocess by multiprocess pool. When I use multiple clients to access the server, I found the following two problems: all clients access same server subprocess client raise MaybeEncodingError By the way, my…
Long.zhao
  • 1,085
  • 2
  • 11
  • 16
10
votes
2 answers

Apple M1 - Symbol not found: _CFRelease while running Python app

I am hoping to run my app without any problem, but I got this attached error. Could someone help or point me into the right direction as to why this is happening? Traceback (most recent call last): File…
enchant3dmango
  • 303
  • 3
  • 13
10
votes
3 answers

How to inspect clients that are connected to a GRPC server

To provide better debugging information for my GRPC server/client setup, I am trying to find an API for grpc.server that allows me to inspect what clients are connected to the server. The most promising question I have found is question, which gives…
pmelanson
  • 330
  • 4
  • 16
9
votes
1 answer

Use retryPolicy with python GRPC client

I have tried really hard to use the embed retryPolicy of GRPC documentation (https://github.com/grpc/proposal/blob/master/A6-client-retries.md#retry-policy) but i fail to understand where i should setup the config in my code. Ideally i would like…
cp2587
  • 513
  • 1
  • 6
  • 12
9
votes
0 answers

gRPC channel.close() taking 10 seconds

I'm trying to use the following code in my production server(which I want to scale it to more than 500 TPS). I'm facing the following issue when I flood the server with many requests. In atleast 1 request in 1000 requests the channel.close() call is…
9
votes
3 answers

How to define a global error handler in gRPC python

Im trying to catch any exception that is raised in any servicer so I can make sure that I only propagate known exceptions and not unexpected ones like ValueError, TypeError etc. I'd like to be able to catch any raised error, and format them or…
Sebastian
  • 1,243
  • 1
  • 18
  • 34
8
votes
0 answers

Mocking grpc response message in python

Recently I have been getting my hand dirty to mock gRPC calls in python using MagicMock() but I have been not successful in mocking gRPC response message which I have got. Here is the piece of code python client code def senor_read(self,…
pkumarn
  • 1,383
  • 4
  • 22
  • 29
8
votes
2 answers

How do I generate python grpc code from within a setuptools installer (setup.py)?

We have some proto files for gRPC in a repo and I read that it is not good to commit generated code. So I figured I need to have the generation as part of the package installation (e.g. setuptools, setup.py) However, to generate gRPC code, you need…
Tom
  • 554
  • 5
  • 22
7
votes
2 answers

Python ProcessPoolExecutor process inside gRPC server dies without throwing any errors

I have a gRPC server which uses ProcessPoolExecutor with max_workers=1 to run a script. Here is why i had to use a ProcessPoolExecutor inside run_brain_application with max_workers=1. Below is the simplified version of the server script. I've put…
James
  • 113
  • 4
7
votes
1 answer

How to hot reload grpc-server in python?

I'm developing some python microservices with grpc and i'm using docker for the cassandra database and the microservices. Is there a way to setup reload on change within docker-compose? I'm guessing that first I need the code mounted as a volume but…
Luis Liz
  • 1,939
  • 4
  • 20
  • 31
1
2 3
26 27