diff --git a/pkg/proxy/userspace/proxysocket.go b/pkg/proxy/userspace/proxysocket.go index 9cdbbd8dd47..0dd2d040d91 100644 --- a/pkg/proxy/userspace/proxysocket.go +++ b/pkg/proxy/userspace/proxysocket.go @@ -153,8 +153,6 @@ func proxyTCP(in, out *net.TCPConn) { go copyBytes("from backend", in, out, &wg) go copyBytes("to backend", out, in, &wg) wg.Wait() - in.Close() - out.Close() } 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()) n, err := io.Copy(dest, src) if err != nil { - glog.Errorf("I/O error: %v", err) + if !isClosedError(err) { + glog.Errorf("I/O error: %v", err) + } } glog.V(4).Infof("Copied %d bytes %s: %s -> %s", n, direction, src.RemoteAddr(), dest.RemoteAddr()) - dest.CloseWrite() - src.CloseRead() + dest.Close() + src.Close() } // udpProxySocket implements proxySocket. Close() is implemented by net.UDPConn. When Close() is called,