Expand description
Coordination between the daemon’s background image download and a session launch that needs the same image.
The daemon downloads every configured container image shortly after it starts. A person who creates a session during that download must not start a second download of the same image: the two would compete for the same bandwidth and the same layer store. Instead the launch waits for the one already running, and then finds the image present.
There is one lock per (host, image) pair. Whoever is allowed to download holds it; whoever needs the image waits on it.
The lock also holds a file lock in the instance’s data directory, because
mj doctor --smoke runs its smoke test in its own
process while the daemon may be downloading the same image. Two engines
pulling one image at once can fail to extract a layer.