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

lxd/daemon: Fix task mutex double unlock #13486

Merged
merged 2 commits into from
May 18, 2024

Conversation

MggMuggins
Copy link
Contributor

As described in #12540

Because we are storing the `task.Group` by value in `Daemon`, replacing
it after the timeout re-initializes the Mutex, leaving it unlocked. If
some task exceeds the timeout at just the right time, it will lock the
old mutex and then unlock the new one, generating a panic.

Fixes canonical#12540

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
@MggMuggins MggMuggins force-pushed the fix-task-mutex-double-unlock branch from f8619c0 to 0505e43 Compare May 17, 2024 22:58
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@tomponline tomponline merged commit d8433ff into canonical:main May 18, 2024
29 checks passed
@MggMuggins MggMuggins deleted the fix-task-mutex-double-unlock branch May 18, 2024 13:15
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