willwill
willwill

Reputation: 1056

gRPC not dropping disconnected channel

Steps to reproduce

  1. Start server
  2. Send a client RPC to server
  3. Restart server
  4. Using the same client, send another RPC. The call will fail
  5. Send another RPC, this call will success

Also I found that if the server is leave stopped for a long time before starting up again, the call in step 5 will return "channel is in state TRANSIENT_FAILURE" as well.

Example code: https://github.com/whs/grpc-repro (Install from requirements.txt then run main.py)

Expected result

All call should success.

Tested with Python grpcio==1.19.0 server/client and with go-grpc server. I tried setting grpc.max_connection_age_grace_ms, grpc.max_connection_age_ms, grpc.max_connection_idle_ms, grpc.keepalive_time_ms, grpc.keepalive_permit_without_calls but they doesn't seems to help.

Upvotes: 1

Views: 2360

Answers (1)

Lidi Zheng
Lidi Zheng

Reputation: 2091

The question is duplicated with https://groups.google.com/forum/#!msg/grpc-io/199V_iF0NMw/NahHz_vMBwAJ.


The feature you want probably is "wait_for_ready". In case of TRANSIENT_FAILURE (server not available temporarily), it will automatically wait for the channel become READY again without failing. Read more about wait for ready.

Upvotes: 1

Related Questions