What Happened
readWriteToCloserWrapper in pkg/ioutils/readers.go embeds io.Reader directly with no synchronization between Read and Close. When Close is called by one goroutine while another is reading (e.g. via tar-split NewInputTarStream), it results in a nil pointer dereference panic in
bufio.(*Reader).Read.This causes CRI-O crash loops during concurrent ImagePull/ImageStatus operations: cri-o/cri-o#10179
Reproducer and full analysis in the CRI-O issue above.
Happy to submit a fix PR.
What Happened
readWriteToCloserWrapper in pkg/ioutils/readers.go embeds io.Reader directly with no synchronization between Read and Close. When Close is called by one goroutine while another is reading (e.g. via tar-split NewInputTarStream), it results in a nil pointer dereference panic in
bufio.(*Reader).Read.This causes CRI-O crash loops during concurrent ImagePull/ImageStatus operations: cri-o/cri-o#10179
Reproducer and full analysis in the CRI-O issue above.
Happy to submit a fix PR.