Merge pull request #24487 from cjcullen/sshleak
Automatic merge from submit-queue Fix goroutine leak in ssh-tunnel healthcheck. Tunnel healthchecks were not closing the HTTP response body, leading to many open goroutines.
This commit is contained in:
		@@ -362,8 +362,12 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error {
 | 
				
			|||||||
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
 | 
							TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	client := &http.Client{Transport: transport}
 | 
						client := &http.Client{Transport: transport}
 | 
				
			||||||
	_, err := client.Get(l.healthCheckURL.String())
 | 
						resp, err := client.Get(l.healthCheckURL.String())
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						resp.Body.Close()
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {
 | 
					func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user