Skip to content

Commit

Permalink
Merge pull request #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 committed Dec 20, 2018
2 parents 5359488 + a81beea commit 39e6a03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func getCSIConnection() (connection.CSIConnection, error) {
}

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 checkHealth(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 39e6a03

Please sign in to comment.