rfyiamcool/grpc-client-pool

connect to backend server err would cause many goroutines been stuck at client.go#L104

Closed this issue · 1 comments

we integrate client.go into our api-gateway.
when our backend gRPC server become unavailable,
our api-gateway process's cpu&memory&goroutines all goes up.

the problem is that client.go uses grpc.Dial() with grpc.WithBlock(),
so when server goes down, every call to grpcpool.getConn() will take 3-second to finish,
causing more and more goroutines got stuck at client.go#L104

thank u