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

IPAM: fix subnet mutex not released when static IP is out of range #2979

Merged
merged 1 commit into from
Jun 25, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Jun 25, 2023

What type of this PR

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at 8795e83

Fix concurrency issue in GetStaticAddress function. Use defer to unlock mutex and avoid potential deadlocks in pkg/ipam/subnet.go.

🤖 Generated by Copilot at 8795e83

There once was a function called GetStaticAddress
That had a concurrency issue to address
It used a mutex lock
But forgot to unlock
So it fixed it with a defer, no less

HOW

🤖 Generated by Copilot at 8795e83

  • Add a deferred call to unlock the subnet mutex in GetStaticAddress (link)
  • Remove the redundant explicit call to unlock the subnet mutex in GetStaticAddress (link)

@zhangzujian zhangzujian added bug Something isn't working need backport labels Jun 25, 2023
@zhangzujian zhangzujian marked this pull request as ready for review June 25, 2023 09:21
@zhangzujian zhangzujian merged commit daa436d into kubeovn:master Jun 25, 2023
@zhangzujian zhangzujian deleted the fix-lock branch June 25, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants