diff --git a/cmd/main.go b/cmd/main.go index 8e18b80c..56c75002 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -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 { @@ -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 {