From fd86b5cb675a1717decd7c1de6600f8172d39800 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Tue, 17 Jan 2023 11:21:39 +0900 Subject: [PATCH] bugfix status handling for idle connection (#1921) Signed-off-by: hlts2 Signed-off-by: hlts2 --- internal/net/grpc/pool/pool.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/net/grpc/pool/pool.go b/internal/net/grpc/pool/pool.go index 20c47ef463c..a30a82cfd43 100644 --- a/internal/net/grpc/pool/pool.go +++ b/internal/net/grpc/pool/pool.go @@ -547,9 +547,12 @@ func isHealthy(conn *ClientConn) bool { switch state { case connectivity.Ready: return true - case connectivity.Idle, connectivity.Connecting: + case connectivity.Connecting: log.Debugf("grpc target %s's connection status will be Ready soon:\tstatus: %s", conn.Target(), state.String()) return true + case connectivity.Idle: + log.Debugf("grpc target %s's connection status is waiting for target:\tstatus: %s", conn.Target(), state.String()) + return false case connectivity.Shutdown, connectivity.TransientFailure: log.Errorf("grpc target %s's connection status is unhealthy:\tstatus: %s", conn.Target(), state.String()) return false