Skip to content

Commit

Permalink
fix: nil pointer in health check request (#38266)
Browse files Browse the repository at this point in the history
issue: #35563
pr: #35589

Signed-off-by: jaime <[email protected]>
  • Loading branch information
jaime0815 authored Dec 6, 2024
1 parent 075b62e commit 51eb254
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/datacoord/session_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion internal/querycoordv2/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 51eb254

Please sign in to comment.