Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volplugin, systemtests: Incorporated mount locks #327

Merged
merged 2 commits into from
Jul 15, 2016
Merged

volplugin, systemtests: Incorporated mount locks #327

merged 2 commits into from
Jul 15, 2016

Conversation

yuva29
Copy link
Contributor

@yuva29 yuva29 commented Jul 7, 2016

fixes #295


if dc.increaseMount(volName) > 1 {
if !volConfig.Unlocked && mountCount > 1 {
if mountCount > 2 { // keeping counter=2 during locked mounts helps docker unmount from removing the actual mount
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to do this decrease here. If the mount is requested multiple times in parallel this will inflate the value, but still cause docker to issue an unmount and eventually go below 0 (which deliberately causes a panic). Let's somehow make sure this is tested directly if you feel the need to keep it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. You are right. It is not required and In fact that code path will never be executed as consecutive unmount after mount failure will always keep counter at 1 and never > 2. I'm working on fixing this.

@erikh
Copy link
Contributor

erikh commented Jul 7, 2016

I'm guessing the passing tests just answered my questions re: NFS. Missed that sorry.

I think we just need a very aggressive test to trigger the mount locking race I think we still have here. If not, we still have an extra test, so this should still be a good use of time. Let's discuss offline how that test might look.

@dseevr
Copy link
Contributor

dseevr commented Jul 7, 2016

Only comment I have is that you might want to configure your editor to automatically run gofmt on your code when you save it. There's a few spacing issues, etc. but nothing serious.

@erikh
Copy link
Contributor

erikh commented Jul 7, 2016

Hmm that makes me think it might be time to add gofmt checks like our golint/vet ones, etc.

@yuva29
Copy link
Contributor Author

yuva29 commented Jul 7, 2016

That sounds goods to add gofmt along with other go tools.

@erikh
Copy link
Contributor

erikh commented Jul 7, 2016

#328 provided for future expansion.

@yuva29
Copy link
Contributor Author

yuva29 commented Jul 11, 2016

#333 docker bug

@unclejack
Copy link
Contributor

This needs to be rebased on master.

@@ -170,7 +167,7 @@ func (s *systemtestSuite) TestVolpluginRestartMultiMount(c *C) {
_, err := s.mon0cmd("sudo truncate -s0 /tmp/volplugin.log")
c.Assert(err, IsNil)

c.Assert(s.createVolume("mon0", "policy1", "test", nil), IsNil)
c.Assert(s.createVolume("mon0", "policy1", "test", map[string]string{"unlocked": "true"}), IsNil)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should not be unlocked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If its not unlocked, multiple mounts won't be possible which will contradict the test case.

Copy link
Contributor

Choose a reason for hiding this comment

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

ohhh becuase it's same host. ok, thanks.

@yuva29
Copy link
Contributor Author

yuva29 commented Jul 13, 2016

This patch will not do graceful unmount due to this issue #333

Until docker fixes the issue, its safe to use this mount format policy1/test:/mnt:no copy

cc @erikh @dseevr @unclejack

@@ -2,78 +2,93 @@ package systemtests

import (
"fmt"
. "gopkg.in/check.v1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put this line, surrounded by whitespace lines, on line 11. This is where https://github.com/bradfitz/goimports would put it by default (we can discuss tooling further offline if you want)

@dseevr
Copy link
Contributor

dseevr commented Jul 15, 2016

@unclejack it's rebased now

@yuva29 is this ready for final review?

@yuva29
Copy link
Contributor Author

yuva29 commented Jul 15, 2016

@dseevr Yeah.

@erikh
Copy link
Contributor

erikh commented Jul 15, 2016

LGTM

@erikh
Copy link
Contributor

erikh commented Jul 15, 2016

can everyone review this today? This is the last mile for v0.2.

@dseevr
Copy link
Contributor

dseevr commented Jul 15, 2016

LGTM

@yuva29 yuva29 modified the milestone: 0.2 Jul 15, 2016
@erikh erikh merged commit 8677925 into contiv-experimental:master Jul 15, 2016
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.

Option to lock mounts on the same host
4 participants