some registries with slow virus scanners take >30s to emit headers; containerd can't pull images
Description
A 30s HTTP response header timeout was added in https://github.com/containerd/containerd/pull/13164 to fix a slow timeout seen in AKS https://github.com/containerd/containerd/issues/13006
Unfortunately some private registries (e.g. Nexus) when configured with anti-virus image scanning can take > 30s to scan a layer (which can be large), and they delay sending response headers until after the scan. The scan seems to be per pull attempt, so retrying doesn't help. The result is that containerd can't pull the images.
Steps to reproduce the issue
I don't have access to the private registry configuration myself so I reproduced it locally by creating a custom registry with a configurable HTTP response header delay.
Describe the results you received and expected
Ideally it should be possible to pull images even if the registry is really slow. Perhaps the perfect response header timeout is environment-specific and AKS should use 30s but the default should still be to wait (i.e. the Go HTTP client default)
What version of containerd are you using?
2.3.0
Any other relevant information
No response
Show configuration if it is related to CRI plugin.
No response
Source: containerd/containerd