Skip to content

Commit 39e6a03

Browse files
authored
Merge pull request #27 from sbezverk/issue_26
Fixing leaking connections
2 parents 5359488 + a81beea commit 39e6a03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ func getCSIConnection() (connection.CSIConnection, error) {
6868
}
6969

7070
func checkHealth(w http.ResponseWriter, req *http.Request) {
71-
7271
glog.Infof("Request: %s from: %s\n", req.URL.Path, req.RemoteAddr)
7372
csiConn, err := getCSIConnection()
7473
if err != nil {
@@ -77,6 +76,7 @@ func checkHealth(w http.ResponseWriter, req *http.Request) {
7776
glog.Infof("Failed to get connection to CSI with error: %v.", err)
7877
return
7978
}
79+
defer csiConn.Close()
8080
ctx, cancel := context.WithTimeout(context.Background(), *connectionTimeout)
8181
defer cancel()
8282
if err := runProbe(ctx, csiConn); err != nil {

0 commit comments

Comments
 (0)