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

enhance: add volume lock #1531

Merged
merged 1 commit into from
Jun 20, 2018
Merged

Conversation

shaloulcy
Copy link
Contributor

Signed-off-by: Eric Li lcy041536@gmail.com

Ⅰ. Describe what this PR did

Right now, the volume core has no lock. It may have problems in some race conditions. In this pull request, we add volume lock.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

Codecov Report

Merging #1531 into master will decrease coverage by 1.53%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1531      +/-   ##
==========================================
- Coverage   40.75%   39.22%   -1.54%     
==========================================
  Files         256      254       -2     
  Lines       16756    17488     +732     
==========================================
+ Hits         6829     6859      +30     
- Misses       9048     9752     +704     
+ Partials      879      877       -2
Impacted Files Coverage Δ
storage/volume/core.go 55.61% <100%> (+3.94%) ⬆️
apis/server/container_bridge.go 60% <0%> (-23.7%) ⬇️
apis/server/router.go 75.14% <0%> (-16.22%) ⬇️
daemon/mgr/container_state.go 67.07% <0%> (-15.02%) ⬇️
daemon/mgr/container.go 34.22% <0%> (-14.84%) ⬇️
cri/v1alpha2/cri.go 0% <0%> (ø) ⬆️
cri/v1alpha1/cri.go 0% <0%> (ø) ⬆️
cli/main.go 0% <0%> (ø) ⬆️
cli/kill.go
client/container_kill.go
... and 3 more

@fuweid
Copy link
Contributor

fuweid commented Jun 19, 2018

@shaloulcy Could you mind to provide more information about impact if we have the race condition?

@shaloulcy
Copy link
Contributor Author

shaloulcy commented Jun 19, 2018

@fuweid Fine. The volume name is unique, no two volumes have the same volume name. Now we create two volumes with the same volume name. If the pouchd has no volume lock, the pouchd will create the volume in the same time, the result is unpredictable.

@fuweid fuweid self-requested a review June 19, 2018 12:36
Signed-off-by: Eric Li <lcy041536@gmail.com>
@fuweid
Copy link
Contributor

fuweid commented Jun 20, 2018

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants