CRI: 当 image_pull_progress_timeout 设置为 "0s"(默认传输服务路径) 时, PullImage 会永久挂起
作者: refleeexzz创建于 2026年9月13日更新于 2026年9月14日
标签kind/bug
根本原因。 我在这个问题上走了一段弯路,罪魁祸首是传输拉取路径上的进度报告器。它是围绕一个未缓冲的通道构建的,其唯一的读者在超时为零时永远不会启动:
newTransferProgressReporter创建通道时将其设置为未缓冲(internal/cri/server/images/image_pull.go:951):
pc: make(chan transfer.Progress),start()在超时为零时提前退出,因此没有任何进程从pc中读取(internal/cri/server/images/image_pull.go:1011-1015):
func (reporter *transferProgressReporter) start(ctx context.Context) {
if reporter.timeout == 0 {
log.G(ctx).Infof("no timeout and will not start pulling image %s reporter", reporter.ref)
return
}
}
3. 但我们向传输服务传递的进度函数仍然**向 `pc` 发送**,其唯一的逃生出口是一个在传输返回后被取消的上下文(`internal/cri/server/images/image_pull.go:342-343`和`1075-1082`):
```go
…内容来源: containerd/containerd