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

Return error from locking.Lock #12382

Merged
merged 10 commits into from
Oct 16, 2023
Merged

Return error from locking.Lock #12382

merged 10 commits into from
Oct 16, 2023

Conversation

roosterfish
Copy link
Contributor

In case the provided context for locking.Lock() gets cancelled an error is returned. This obsoletes any != nil checks for the returned unlock function.

See here for some more reasoning: #12304 (comment)

lxd/locking/lock.go Outdated Show resolved Hide resolved
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
@tomponline tomponline merged commit f134f11 into canonical:main Oct 16, 2023
24 of 25 checks passed
@roosterfish roosterfish deleted the lock_err branch October 16, 2023 13:24
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.

2 participants