Skip to content

Commit

Permalink
Merge pull request kubernetes-csi#27 from sbezverk/issue_26
Browse files Browse the repository at this point in the history
Fixing leaking connections
  • Loading branch information
k8s-ci-robot authored and sbezverk committed Dec 20, 2018
1 parent 857ef60 commit a51277f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ func getCSIConnection() (connection.CSIConnection, error) {
return csiConn, nil
}

func chekcHealth(w http.ResponseWriter, req *http.Request) {

func checkHealth(w http.ResponseWriter, req *http.Request) {
glog.Infof("Request: %s from: %s\n", req.URL.Path, req.RemoteAddr)
csiConn, err := getCSIConnection()
if err != nil {
Expand All @@ -77,6 +76,7 @@ func chekcHealth(w http.ResponseWriter, req *http.Request) {
glog.Infof("Failed to get connection to CSI with error: %v.", err)
return
}
defer csiConn.Close()
ctx, cancel := context.WithTimeout(context.Background(), *connectionTimeout)
defer cancel()
if err := runProbe(ctx, csiConn); err != nil {
Expand Down

0 comments on commit a51277f

Please sign in to comment.