Skip to content

Commit

Permalink
Merge #35185
Browse files Browse the repository at this point in the history
35185: cli: fix nil pointer error in debug zip r=jordanlewis a=jordanlewis

Closes #35184.

Release note: None

Co-authored-by: Jordan Lewis <[email protected]>
  • Loading branch information
craig[bot] and jordanlewis committed Feb 25, 2019
2 parents a0b98ad + bfb9d6a commit 7013956
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/cli/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,26 +271,30 @@ func runDebugZip(cmd *cobra.Command, args []string) error {
}
}

var stacks *serverpb.JSONResponse
var stacksData []byte
err = contextutil.RunWithTimeout(baseCtx, "request stacks", timeout,
func(ctx context.Context) error {
stacks, err = status.Stacks(ctx, &serverpb.StacksRequest{NodeId: id})
stacks, err := status.Stacks(ctx, &serverpb.StacksRequest{NodeId: id})
if err != nil {
stacksData = stacks.Data
}
return err
})
if err := z.createRawOrError(prefix+"/stacks", stacks.Data, err); err != nil {
if err := z.createRawOrError(prefix+"/stacks", stacksData, err); err != nil {
return err
}

var heap *serverpb.JSONResponse
var heapData []byte
err = contextutil.RunWithTimeout(baseCtx, "request heap profile", timeout,
func(ctx context.Context) error {
heap, err = status.Profile(ctx, &serverpb.ProfileRequest{
heap, err := status.Profile(ctx, &serverpb.ProfileRequest{
NodeId: id,
Type: serverpb.ProfileRequest_HEAP,
})
heapData = heap.Data
return err
})
if err := z.createRawOrError(prefix+"/heap", heap.Data, err); err != nil {
if err := z.createRawOrError(prefix+"/heap", heapData, err); err != nil {
return err
}

Expand Down

0 comments on commit 7013956

Please sign in to comment.