Skip to content

Commit

Permalink
tabls: fix resp is nil and change resp check (#52035)
Browse files Browse the repository at this point in the history
close #52034
  • Loading branch information
HuSharp authored Mar 25, 2024
1 parent b8b3b92 commit b2a9a56
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -1988,8 +1988,7 @@ func getMicroServiceServerInfo(ctx sessionctx.Context, serviceName string) ([]Se
}
req.Header.Add("PD-Allow-follower-handle", "true")
resp, err := util.InternalHTTPClient().Do(req)
// PD is not in the microservice mode
if resp.StatusCode == http.StatusServiceUnavailable {
if resp == nil || resp.StatusCode != http.StatusOK {
terror.Log(resp.Body.Close())
return servers, nil
}
Expand Down

0 comments on commit b2a9a56

Please sign in to comment.