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

CP-39600: Rework LVM locking to use fair lock queue #658

Merged

Conversation

TimSmithCtx
Copy link
Contributor

This is intended to prevent a storm of later LVM commands from usurping the lock that an earlier command is waiting for, just because they happened to manage to start waiting before the original holder was done.

In some pathalogical circumstances, this has been known to result in a commant taking many minutes to get the lock.

Copy link
Contributor

@MarkSymsCtx MarkSymsCtx left a comment

Choose a reason for hiding this comment

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

Some minor changes, and the tests need fixing to work properly.

drivers/LVHDSR.py Outdated Show resolved Hide resolved
drivers/LVHDSR.py Show resolved Hide resolved
drivers/lock.py Outdated Show resolved Hide resolved
drivers/lock_queue.py Outdated Show resolved Hide resolved
drivers/lock_queue.py Show resolved Hide resolved
drivers/lvutil.py Outdated Show resolved Hide resolved
tests/test_LVHDSR.py Outdated Show resolved Hide resolved
tests/test_lock_queue.py Outdated Show resolved Hide resolved
@TimSmithCtx TimSmithCtx force-pushed the private/timsmi/CP-39600 branch 2 times, most recently from 9bc8953 to bd54b9f Compare November 29, 2023 15:04
MarkSymsCtx
MarkSymsCtx previously approved these changes Nov 29, 2023
@MarkSymsCtx MarkSymsCtx requested a review from rdn32 November 30, 2023 09:26
tests/test_lvutil.py Outdated Show resolved Hide resolved
Copy link
Contributor

@rdn32 rdn32 left a comment

Choose a reason for hiding this comment

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

The only serious thing was that I think I saw a potential race condition in LockQueue's constructor, which looks like it could be readily fixed with the queue lock.

drivers/lock_queue.py Outdated Show resolved Hide resolved
drivers/lock_queue.py Outdated Show resolved Hide resolved
tests/test_lock_queue.py Show resolved Hide resolved
tests/test_lock_queue.py Outdated Show resolved Hide resolved
tests/test_lock_queue.py Outdated Show resolved Hide resolved
drivers/lock_queue.py Show resolved Hide resolved
@TimSmithCtx TimSmithCtx force-pushed the private/timsmi/CP-39600 branch 2 times, most recently from 2ec3127 to 28ba68c Compare December 4, 2023 10:24
@rdn32 rdn32 self-requested a review December 4, 2023 13:55
rdn32
rdn32 previously approved these changes Dec 4, 2023
This is intended to prevent a storm of later LVM commands from usurping
the lock that an earlier command is waiting for, just because they
happened to manage to start waiting before the original holder was done.

In some pathalogical circumstances, this has been known to result in a
commant taking many minutes to get the lock.

Signed-off-by: Tim Smith <tim.smith@cloud.com>
@TimSmithCtx TimSmithCtx force-pushed the private/timsmi/CP-39600 branch from a32f13d to ffae900 Compare December 5, 2023 11:11
@TimSmithCtx TimSmithCtx merged commit 125aa9e into xapi-project:master Dec 6, 2023
2 checks passed
@TimSmithCtx TimSmithCtx deleted the private/timsmi/CP-39600 branch December 6, 2023 10: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.

3 participants