grpc: python client often report errors StatusCode.UNAVAILABLE deadline exceeded
What version of gRPC and what language are you using?
vesion: grpcio==1.22.0 language: python
What operating system (Linux, Windows,…) and version?
Linux in docker container
What runtime / compiler are you using (e.g. python version or version of gcc)
python3.6
What did you do?
client and server also use grpc with python, I use a thread to get grpc server’s ip and port from consul. And this is my client code
opts = [ ('grpc.max_message_length', 1024 * 1024 * 1024),
('grpc.max_send_message_length', 1024 * 1024 * 1024),
('grpc.max_receive_message_length', 1024 * 1024 * 1024),
('grpc.keepalive_time_ms', 10000),
('grpc.keepalive_timeout_ms', 1000),
('grpc.max_connection_idle_ms',1000 * 50)
]
channel = grpc.insecure_channel('%s:%d'%(ip, port),opts)
stub = call_pb2_grpc.RemoteCallStub(channel)
ct = time.time()
try:
result = stub.get_result(call_pb2.Request(method_name=method_name,
arg=json.dumps(args)
), timeout=10,wait_for_ready=True
))
except Exception as e:
channel.close()
my client and server also use in docker container, and Relations are many-to-many
What did you expect to see?
I hope it can be invoked steadily
What did you see instead?
After running for a period of time,Clients often report errors
StatusCode.UNAVAILABLE deadline exceeded
I’ve added service tracking,when I search the record ,I learned that the server did not receive these requests. I run netstat -na|grep ESTABLISHED in client ,See that the connection between client and server is blocked
Anything else we should know about your project / environment?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (6 by maintainers)
E0813 08:47:14.154801376 63 chttp2_transport.cc:2801] ipv4:10.22.15.10:80: Keepalive watchdog fired. Closing transport.