Skip to content

Commit

Permalink
Fixing leaking connections
Browse files Browse the repository at this point in the history
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
  • Loading branch information
sbezverk committed Dec 20, 2018
1 parent 5359488 commit a81beea
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 a81beea

Please sign in to comment.