Skip to content

Commit

Permalink
fix lvmd connection leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jul 16, 2018
1 parent 75fe2de commit 423dcfa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/lvm/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (cs *controllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
}

conn, err := lvmd.NewLVMConnection(addr, connectTimeout)
defer conn.Close()
if err != nil {
return nil, status.Error(codes.Internal, fmt.Sprintf("Failed to connect to %v: %v", addr, err))
}
Expand Down
1 change: 1 addition & 0 deletions pkg/lvm/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (ns *nodeServer) createVolume(ctx context.Context, volumeId string) (*v1.Pe
}

conn, err := lvmd.NewLVMConnection(addr, connectTimeout)
defer conn.Close()
if err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("Failed to connect to %v: %v", addr, err))
}
Expand Down

0 comments on commit 423dcfa

Please sign in to comment.