Containerd panics with fatal error: concurrent map writes
when pull images concurrently
#8742
Labels
fatal error: concurrent map writes
when pull images concurrently
#8742
Description
Containerd paniced when during concurrent image pulling. I believe the following is the root cause, but feel free to correct me if I missed anything:
Since
c.config.Registry.Headers
is a global map, concurrent image pull could result in concurrent map.Setcontainerd/pkg/cri/server/image_pull.go
Line 133 in 9b4ed8a
options.Headers.Set("User-Agent", "containerd/"+version.Version)
could result to concurrent map writehttps://github.com/containerd/containerd/blob/9b4ed8acc2a04a3f8df140e79052d18b750d757e/remotes/docker/resolver.go#L153C1-L153C1
Steps to reproduce the issue
We had a client using CRI client calling PullImage almost at the same time and can get a repro.
Describe the results you received and expected
Got a panic when pulling images concurrently when calling CRI.PullImage API. Expecting pullImage to be thread safe
What version of containerd are you using?
1.6.9.4
Any other relevant information
No response
Show configuration if it is related to CRI plugin.
No response
The text was updated successfully, but these errors were encountered: