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

Testing asyncio grpc server (mostly about asyncio)

Disclaimer: I'm new to using asyncio so this might be an easy fix. I'm trying to write tests for the endpoints of an asynchronous grpc-server. The server has to regularly check something using a function that runs in an infinite loop, and still be…
wiseboar
  • 175
  • 2
  • 13
0
votes
2 answers

python3 resolve relative import with internal dependency inside module

My folder structure: grpc/ server.py client.py ... src/ __init__.py image_pb2.py image_pb2_grpc.py ... server.py import image_pb2_grpc import image_pb2 ... image_pb_grpc.py import…
Zabir Al Nazi
  • 10,298
  • 4
  • 33
  • 60
0
votes
1 answer

502 Server Error on (GRPC Transcoding) REST API and 200 OK on GRPC - Cloud Endpoints on GKE

After having deployed my GPRPC server on GKE with ESP and Cloud Endpoints api_config file, I am able to test correctly (200 OK) the requests using the GRPC client but all CURL requests using REST API transcoded fail with a weird : "502 Server Error…
0
votes
1 answer

How do i timing streaming messages with Python gRPC

As the answer in the question: how-do-i-handle-streaming-messages-with-python-grpc, @Nathaniel provides a solution to handle request and response. But when I want to statistics the process time of every response, it just doesn't look right. For…
0
votes
1 answer

Creating grpc server and client python interfaces from URL

I was wondering if it is possible to generate the interfaces from a git repository location instead of relative directory locations. I tried python -m grpc.tools.protoc \ --proto_path=https://github..../../protos/ \ --grpc_python_out=.…
Elefhead
  • 161
  • 1
  • 8
0
votes
0 answers

rpc error: code = Unavailable desc = upstream connect error or disconnect/reset before headers. reset reason: protocol error

I'm trying to use GCP Cloud run to host both a REST and a gRPC service. I'm using sonora to multiplex the server so to be able to use the same port (443) for both services. This is my init application so far: from flask import Flask from sonora.wsgi…
nicolasassi
  • 490
  • 4
  • 14
0
votes
1 answer

What is the correct way to add_done_callback in grpc?

If I add_done_callback to a grpc future object, did I need to close channel? class CallBack(object): def __init__(self,channel=None) -> None: self._channel = channel def __call__(self, future): print(self.future.result()) …
ehds
  • 665
  • 1
  • 6
  • 16
0
votes
1 answer

gRPC Python server to client communication through function call

Let's say I am building a simple chat app using gRPC with the following .proto: service Chat { rpc SendChat(Message) returns (Void); rpc SubscribeToChats(Void) returns (stream Message); } message Void {} message Message {string text =…
Joshua F
  • 110
  • 6
0
votes
1 answer

CA Certs used by GRPC

When I execute google-ads python sample code I get the following error DEBUG:google.auth.transport.requests:Making request: POST https://accounts.google.com/o/oauth2/token DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1):…
uncaught_exception
  • 1,068
  • 6
  • 15
0
votes
3 answers

How to unit test a gRPC server's asynchronous methods?

Following the suggestions in this question I was able to unit test the synchronous methods of my gRPC service (which is built with the grpc.aio API) using the grpc_testing library. However, when I follow this example on an asynchronous method of my…
0
votes
1 answer

why is grpc.FutureTimeoutError not an instance of grpc.RpcError and grpc.Call?

It would make handling of timeouts much cleaner if FutureTimeoutError had methods like code() and details() etc, the same as, say, _InactiveRpcError does. Is this a design decision? Would the grpc community be open to a pull request that changes the…
gmoss
  • 1,019
  • 5
  • 17
0
votes
1 answer

how to stream CSV data over gRPC?

I'm fairly new to microservices and grpc itself so excuse any ignorance. I have a CSV file and I'm trying to iterate through the file line by line in one microservice and then stream each line to another microservice. The second microservice would…
Fiach ONeill
  • 155
  • 13
0
votes
0 answers

Connect to GRPC service through curl?

I have a simple grpc service helloworld. its server is running in ec2 instance behind nginx. I am trying to connect to grpc server from my local machine using curl. I am following the same code that is in official repo so I don't think any problem…
learner
  • 117
  • 2
  • 10
0
votes
1 answer

InactiveRpcError when trying to connect to Google Cloud Run rpc service

I currently have a gRPC server running on a google cloud run instance that built and deployed successfully. When I run and connect my client to it locally, it works fine. However, when I deploy it to google cloud run and attempt to connect to the…
0
votes
2 answers

Grpc Error on Long Connections: Too Many Pings

I am building a system with a microservice architecture that communicates between services using grpc. I have a long running request in the beginning that hits a central endpoint that makes a bunch of requests to other services. The first request to…
MUAS
  • 519
  • 1
  • 7
  • 20