Bug 1252421
Summary: | Image pool becomes corrupt after parallel docker pull with common ancestor | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Josep 'Pep' Turro Mauri <pep> |
Component: | docker | Assignee: | Vivek Goyal <vgoyal> |
Status: | CLOSED ERRATA | QA Contact: | Luwen Su <lsu> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | dwalsh, lsm5, sdodson, sghosh, spinolacastro |
Target Milestone: | rc | Keywords: | Extras |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | docker-1.7.1-115.el7_1 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-09-15 12:51:17 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Josep 'Pep' Turro Mauri
2015-08-11 11:20:06 UTC
This just showed up at docker. https://github.com/docker/docker/pull/15728 I can confirm https://github.com/docker/docker/pull/15728 solves the issue on docker-1.7.1. As the fix was made for latest docker, i've tried to backport and seems to work very well, here's the patch: diff --git a/graph/graph.go b/graph/graph.go index f305622..28ab1f4 100644 --- a/graph/graph.go +++ b/graph/graph.go @@ -154,6 +154,10 @@ func (graph *Graph) Register(img *image.Image, layerData archive.ArchiveReader) // this doesn't mean Register is fully safe yet. graph.imageMutex.Lock(img.ID) defer graph.imageMutex.Unlock(img.ID) + + if graph.Exists(img.ID) { + return nil + } defer func() { // If any error occurs, remove the new dir from the driver. @@ -164,11 +168,6 @@ func (graph *Graph) Register(img *image.Image, layerData archive.ArchiveReader) } }() - // (This is a convenience to save time. Race conditions are taken care of by os.Rename) - if graph.Exists(img.ID) { - return fmt.Errorf("Image %s already exists", img.ID) - } - // Ensure that the image root does not exist on the filesystem // when it is not registered in the graph. // This is common when you switch from one graph driver to another After rebuild i couldn't reproduce the panic running the following script: for image in openshift/nodejs-010-centos7 openshift/base-centos7 openshift/origin-sti-builder openshift/ruby-20-centos7 openshift/mysql-55-centos7 openshift/python-33-centos7 mesosphere/chronos:chronos-2.3.4-1.0.81.ubuntu1404-mesos-0.22.1-1.0.ubuntu1404 mesosphere/mesos-master:0.22.1-1.0.ubuntu1404 mesosphere/mesos-slave:0.22.1-1.0.ubuntu1404 mesosphere/marathon:v0.8.2-RC4 ; do docker pull $image & done Please update the pull request to give positive feedback. With the comment3 steps, reproduced in docker-1.7.1-114.el7.x86_64, the docker daemon crashed and verified in docker-1.7.1-115.el7.x86_64 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1782.html |