We are sending multiple requests to a gRPC server.
But every once in a while we come across "Connection reset by peer"
error with UNAVAILABLE
status.
GRPC server: NestJS
Client: Python
Python version: 3.8
gRPCio version: 1.50.0
Code:
# Connect to server from client:
def connect_to_user_manager_server() -> AuthorizationControllerStub:
channel = grpc.insecure_channel(envs.USER_MANAGER_GRPC_URL, options=(
('grpc.keepalive_time_ms', 120000),
('grpc.keepalive_permit_without_calls', True),
))
stub = AuthorizationControllerStub(channel)
return stub
client = connect_to_user_manager_server()
user_response = client.CheckAuthorization(authorizationData(authorization=token, requiredRoles=roles))