devmapper: ensure that UdevWait is called after calls to setCookie#33732
Merged
cpuguy83 merged 1 commit intomoby:masterfrom Jun 19, 2017
nhorman:cookie-clean-up
Merged
devmapper: ensure that UdevWait is called after calls to setCookie#33732cpuguy83 merged 1 commit intomoby:masterfrom nhorman:cookie-clean-up
cpuguy83 merged 1 commit intomoby:masterfrom
nhorman:cookie-clean-up
Conversation
Author
|
@rhvgoyal as requested, tagging you to review this |
Contributor
|
@nhorman How about going back to IIRC, UdevWait() inline was redundant once we started doing allocation from heap? |
Recent changes to devmapper broke the implicit requirement that UdevWait be called after every call to task.setCookie. Failure to do so results in leaks of semaphores in the LVM code, eventually leading to semaphore exhaustion. Previously this was handled by calling UdevWait in a ubiquitous defer function. While there was initially some concern with deferring the UdevWait function would cause some amount of race possibiliy, the fact that we never return the cookie value or any value used to find it, makes that possibility seem unlikely, so lets go back to that method Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Contributor
Contributor
|
LGTM |
Contributor
|
I did basic testing and it seems to fix cookies leaking issue when a busy device is being removed. |
Member
Contributor
|
@thaJeztah Right. Last patch in that patch series introduced the issue. |
|
Thank you! Finally it's released! Horaay |
3 tasks
|
cool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent changes to devmapper broke the implicit requirement that UdevWait be
called after every call to task.setCookie. Failure to do so results in leaks of
semaphores in the LVM code, eventually leading to semaphore exhaustion.
Previously this was handled by calling UdevWait in a ubiquitous defer function,
but that had its own problems with ordering between execution of the wait and
other uses of the semaphore. So now we delay returning until after the UdevWait
completes, once we've set the cookie value.
Problem can be observed by running moby with an lvm2 storage backend for extended periods of time. When enough cookies have leaked, then they problem will present.
Signed-off-by: Neil Horman nhorman@tuxdriver.com