From 51eb25438ccd4185066ee9b07695085b6933a73f Mon Sep 17 00:00:00 2001 From: jaime Date: Fri, 6 Dec 2024 13:34:41 +0800 Subject: [PATCH] fix: nil pointer in health check request (#38266) issue: #35563 pr: #35589 Signed-off-by: jaime --- internal/datacoord/session_manager.go | 2 +- internal/querycoordv2/services.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/session_manager.go b/internal/datacoord/session_manager.go index 45a698b8a4e4b..e13896ad9488d 100644 --- a/internal/datacoord/session_manager.go +++ b/internal/datacoord/session_manager.go @@ -538,7 +538,7 @@ func (c *SessionManagerImpl) CheckDNHealth(ctx context.Context) *healthcheck.Res return } - if len(checkHealthResp.Reasons) > 0 { + if checkHealthResp != nil && len(checkHealthResp.Reasons) > 0 { wlock.Lock() result.AppendResult(healthcheck.GetHealthCheckResultFromResp(checkHealthResp)) wlock.Unlock() diff --git a/internal/querycoordv2/services.go b/internal/querycoordv2/services.go index e97aaa9c729f6..7a555fff71f14 100644 --- a/internal/querycoordv2/services.go +++ b/internal/querycoordv2/services.go @@ -1001,7 +1001,7 @@ func (s *Server) broadcastCheckHealth(ctx context.Context) *healthcheck.Result { return } - if len(checkHealthResp.Reasons) > 0 { + if checkHealthResp != nil && len(checkHealthResp.Reasons) > 0 { wlock.Lock() result.AppendResult(healthcheck.GetHealthCheckResultFromResp(checkHealthResp)) wlock.Unlock()