Skip to content

Avoid extra mount/unmount during build - #4096

Merged
crosbymichael merged 1 commit into
moby:masterfrom
alexlarsson:fix-devmapper-race-2
Feb 13, 2014
Merged

crosbymichael merged 1 commit into
moby:masterfrom
alexlarsson:fix-devmapper-race-2

Conversation

@alexlarsson

Copy link
Copy Markdown
Contributor

CmdRun() calls first run() and then wait() to wait for it to exit,
then it runs commit(). The run command will mount the container and
the container exiting will unmount it. Then the commit will
immediately mount it again to do a diff.

This seems minor, but this is actually problematic, as the Get/Put
pair will create a spurious mount/unmount cycle that is not needed and
slows things down. Additionally it will create a supurious
devicemapper activate/deactivate cycle that causes races with udev as
seen in #4036.

To ensure that we only unmount once we split up run() into create()
and run() and reference the mount until after the commit().

With this change docker build on devicemapper is now race-free, and
slightly faster.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson [email protected] (github: alexlarsson)

CmdRun() calls first run() and then wait() to wait for it to exit,
then it runs commit(). The run command will mount the container and
the container exiting will unmount it. Then the commit will
immediately mount it again to do a diff.

This seems minor, but this is actually problematic, as the Get/Put
pair will create a spurious mount/unmount cycle that is not needed and
slows things down. Additionally it will create a supurious
devicemapper activate/deactivate cycle that causes races with udev as
seen in moby#4036.

To ensure that we only unmount once we split up run() into create()
and run() and reference the mount until after the commit().

With this change docker build on devicemapper is now race-free, and
slightly faster.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <[email protected]> (github: alexlarsson)
@discordianfish

Copy link
Copy Markdown
Contributor

LGTM. It fixed the problems I saw on our rackspace systems.

@unclejack

Copy link
Copy Markdown
Contributor

LGTM

@unclejack unclejack added this to the 0.8.1 milestone Feb 13, 2014
@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Feb 13, 2014
Avoid extra mount/unmount during build
@crosbymichael
crosbymichael merged commit 3f1e6b6 into moby:master Feb 13, 2014
@alexlarsson
alexlarsson deleted the fix-devmapper-race-2 branch March 28, 2014 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants