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 <estesp@gmail.com>
This commit is contained in:
Phil Estes
2025-06-30 17:00:27 -04:00
parent 201325e869
commit fa87098ae3

View File

@@ -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: