From 80606c895cfb7582e41cc00b307bb2f926d7b521 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Fri, 20 Jan 2023 14:58:46 +0000 Subject: [PATCH] solve race on NewHTTPProxyHandler Change-Id: I993ac447c31afa52cc2e53cd9a61069fb6d91253 --- staging/src/k8s.io/apimachinery/pkg/util/net/testing/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/net/testing/http.go b/staging/src/k8s.io/apimachinery/pkg/util/net/testing/http.go index 665a461859f..21084602b42 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/net/testing/http.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/net/testing/http.go @@ -131,13 +131,13 @@ func (h *HTTPProxyHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) wg.Add(2) go func() { - defer h.t.Logf("Server read close, host=%s", req.Host) defer wg.Done() + defer h.t.Logf("Server read close, host=%s", req.Host) io.Copy(conn, sconn) }() go func() { - defer h.t.Logf("Server write close, host=%s", req.Host) defer wg.Done() + defer h.t.Logf("Server write close, host=%s", req.Host) io.Copy(sconn, conn) }()