Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

[18.06] Fix bindmount autocreate race #11

Conversation

thaJeztah
Copy link
Member

cherry-pick of moby#37378 for 18.06. cherry-pick was clean; no conflicts

When using the mounts API, bind mounts are not supposed to be
automatically created.

Before this patch there is a race condition between valiating that a
bind path exists and then actually setting up the bind mount where the
bind path may exist during validation but was removed during mountpooint
setup.

This adds a field to the mountpoint struct to ensure that binds created
over the mounts API are not accidentally created.

When using the mounts API, bind mounts are not supposed to be
automatically created.

Before this patch there is a race condition between valiating that a
bind path exists and then actually setting up the bind mount where the
bind path may exist during validation but was removed during mountpooint
setup.

This adds a field to the mountpoint struct to ensure that binds created
over the mounts API are not accidentally created.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 1caeb79)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah changed the title Fix bindmount autocreate race [18.06] Fix bindmount autocreate race Jul 5, 2018
@thaJeztah thaJeztah added this to the 18.06.0 milestone Jul 5, 2018
@thaJeztah
Copy link
Member Author

z failure; moby#34988 / moby#35039

20:26:54 FAIL: check_test.go:347: DockerSwarmSuite.TearDownTest
20:26:54 
20:26:54 check_test.go:352:
20:26:54     d.Stop(c)
20:26:54 /go/src/github.com/docker/docker/internal/test/daemon/daemon.go:401:
20:26:54     t.Fatalf("Error while stopping the daemon %s : %v", d.id, err)
20:26:54 ... Error: Error while stopping the daemon da872e8db3346 : exit status 130
20:26:54 
20:26:54 
20:26:54 ----------------------------------------------------------------------
20:26:54 PANIC: docker_api_swarm_test.go:359: DockerSwarmSuite.TestAPISwarmRaftQuorum
20:26:54 
20:26:54 [da872e8db3346] waiting for daemon to start
20:26:54 [da872e8db3346] daemon started
20:26:54 
20:26:54 [d49b22a30a6dd] waiting for daemon to start
20:26:54 [d49b22a30a6dd] daemon started
20:26:54 
20:26:54 [d52dca75841c7] waiting for daemon to start
20:26:54 [d52dca75841c7] daemon started
20:26:54 
20:26:54 [d49b22a30a6dd] exiting daemon
20:26:54 [d52dca75841c7] exiting daemon
20:26:54 [d49b22a30a6dd] waiting for daemon to start
20:26:54 [d49b22a30a6dd] daemon started
20:26:54 
20:26:54 [da872e8db3346] daemon started
20:26:54 Attempt #2: daemon is still running with pid 16994
20:26:54 Attempt #3: daemon is still running with pid 16994
20:26:54 Attempt #4: daemon is still running with pid 16994
20:26:54 [da872e8db3346] exiting daemon
20:26:54 ... Panic: Fixture has panicked (see related PANIC)

@thaJeztah
Copy link
Member Author

ping @cpuguy83 @kolyshkin @vdemeester PTAL

Copy link

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🤕

@andrewhsu andrewhsu merged commit 22a77b0 into docker-archive:18.06 Jul 9, 2018
@thaJeztah thaJeztah deleted the 18.06-fix_bindmount_src_create_race branch July 9, 2018 22:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants