From fa87098ae30c69b86060a085e22fc8bcba3ab97f Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Mon, 30 Jun 2025 17:00:27 -0400 Subject: [PATCH] fix: kubelet CRI portforward concurrent map write on error Changing this from value printing to just the pointer value fixes a known issue with possible "concurrent map write" errors from the Go runtime when this error occurs. This problem surfaces when the map within the struct `h.conn` is iterated over, but can be modified by other threads while this error is being logged. Phil Estes --- .../k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go b/staging/src/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go index 4d38f454cb6..9e2bd8ec8d7 100644 --- a/staging/src/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go +++ b/staging/src/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go @@ -140,7 +140,7 @@ func (h *httpStreamHandler) getStreamPair(requestID string) (*httpStreamPair, bo func (h *httpStreamHandler) monitorStreamPair(p *httpStreamPair, timeout <-chan time.Time) { select { case <-timeout: - err := fmt.Errorf("(conn=%v, request=%s) timed out waiting for streams", h.conn, p.requestID) + err := fmt.Errorf("(conn=%p, request=%s) timed out waiting for streams", h.conn, p.requestID) utilruntime.HandleError(err) p.printError(err.Error()) case <-p.complete: