mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Merge pull request #18524 from thockin/kube-proxy-close
Auto commit by PR queue bot
This commit is contained in:
commit
5b6a7c6012
@ -153,8 +153,6 @@ func proxyTCP(in, out *net.TCPConn) {
|
|||||||
go copyBytes("from backend", in, out, &wg)
|
go copyBytes("from backend", in, out, &wg)
|
||||||
go copyBytes("to backend", out, in, &wg)
|
go copyBytes("to backend", out, in, &wg)
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
in.Close()
|
|
||||||
out.Close()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyBytes(direction string, dest, src *net.TCPConn, wg *sync.WaitGroup) {
|
func copyBytes(direction string, dest, src *net.TCPConn, wg *sync.WaitGroup) {
|
||||||
@ -162,11 +160,13 @@ func copyBytes(direction string, dest, src *net.TCPConn, wg *sync.WaitGroup) {
|
|||||||
glog.V(4).Infof("Copying %s: %s -> %s", direction, src.RemoteAddr(), dest.RemoteAddr())
|
glog.V(4).Infof("Copying %s: %s -> %s", direction, src.RemoteAddr(), dest.RemoteAddr())
|
||||||
n, err := io.Copy(dest, src)
|
n, err := io.Copy(dest, src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !isClosedError(err) {
|
||||||
glog.Errorf("I/O error: %v", err)
|
glog.Errorf("I/O error: %v", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
glog.V(4).Infof("Copied %d bytes %s: %s -> %s", n, direction, src.RemoteAddr(), dest.RemoteAddr())
|
glog.V(4).Infof("Copied %d bytes %s: %s -> %s", n, direction, src.RemoteAddr(), dest.RemoteAddr())
|
||||||
dest.CloseWrite()
|
dest.Close()
|
||||||
src.CloseRead()
|
src.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// udpProxySocket implements proxySocket. Close() is implemented by net.UDPConn. When Close() is called,
|
// udpProxySocket implements proxySocket. Close() is implemented by net.UDPConn. When Close() is called,
|
||||||
|
Loading…
Reference in New Issue
Block a user