Skip to content

Commit

Permalink
Merge pull request #17710 from callthingsoff/hashKV_nilpanic
Browse files Browse the repository at this point in the history
tools/benchmark/cmd: don't panic with nil values in hashKV function
  • Loading branch information
ahrtr authored Apr 5, 2024
2 parents 5fb82c4 + 27a6dd0 commit 793b3db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/benchmark/cmd/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ func hashKV(cmd *cobra.Command, clients []*v3.Client) {
host := eps[0]

st := time.Now()
rh, eh := clients[0].HashKV(context.Background(), host, 0)
if eh != nil {
fmt.Fprintf(os.Stderr, "Failed to get the hashkv of endpoint %s (%v)\n", host, eh)
rh, err := clients[0].HashKV(context.Background(), host, 0)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to get the hashkv of endpoint %s (%v)\n", host, err)
panic(err)
}
rt, es := clients[0].Status(context.Background(), host)
if es != nil {
fmt.Fprintf(os.Stderr, "Failed to get the status of endpoint %s (%v)\n", host, es)
rt, err := clients[0].Status(context.Background(), host)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to get the status of endpoint %s (%v)\n", host, err)
panic(err)
}

Expand Down

0 comments on commit 793b3db

Please sign in to comment.