Skip to content

Commit

Permalink
tabls: fix resp is nil and change resp check (#52035) (#52053)
Browse files Browse the repository at this point in the history
close #52034
  • Loading branch information
ti-chi-bot authored Mar 25, 2024
1 parent 4a4b8d6 commit 99e63f1
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 99e63f1

Please sign in to comment.